#include<iostream>
using namespace std;
int main(){
int arry[5]={5,9,41,325,85};
//排序总轮次=元素-1
//每轮对比次数=元素个数-1-排序轮数
for (int i = 0; i < 5-1; i++) {//排序轮次
for (int k = 0; k < 5 - 1 - i; k++) {//对比次数
if (arry[k] > arry[k + 1]) {
int temp;
temp = arry[k];
arry[k] = arry[k + 1];
arry[k + 1] = temp;
}
}
}
for (int i = 0; i < 5; i++)
cout << arry[i] <<'\t';
return 0;
}
11-08
300
11-11
634
11-11
400
11-09
754