#include<iostream>
#include<stdlib.h>
using namespace std;
#define MaxNumber 100
int Number[MaxNumber];
int main(){
cout<<"请输入数组的长度:";
int len=0;
cin>>len;
cout<<endl;
int num=0;
cout<<"请输入数组:"<<endl;
for(int i=0;i<len;i++){
cin>>Number[i];
}
for(int i=0;i<len;i++){
for(int j=0;j<i;j++){
if(Number[j]>Number[i]){
num=Number[j];
Number[j]=Number[i];
Number[i]=num;
}
}
cout<<"----------------------------------------------------------------------------------------------------------------"<<endl;
cout<<"第"<<i<<"次排序"<<endl;
cout<<"现在的顺序是:";
for(int n=0;n<len;n++){
cout<<Number[n]<<" ";
}
cout<<endl;
}
return 0;
}