#include<iostream>
using namespace std;
#include<ctime>
#include<string>
int main() {
int arr[] = { 4,2,8,0,5,7,1,3,9 };
int len = sizeof(arr) / sizeof(arr[0]);
for (int i = 0; i < len; i++)//排序总轮数
{
for (int j = 0; j < len - i - 1; j++) {//每轮对比次数
if (arr[j + 1] < arr[j]) {
int temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
}
for (int a = 0; a < 9; a++) {
cout << arr[a] << endl;
}
system("pause");
return 0;
}