#include <iostream>
using namespace std;int main()
{// 利用冒泡排序实现升序序列int arr[9] = {4, 2, 8, 0, 5, 7, 1, 3, 9};cout << "排序前: " << endl;for (int i = 0; i < 9; i++){cout << arr[i] << " ";}cout << endl;// 开始冒泡排序for (int i = 0; i < 9; i++){for (int j = i + 1; j < 9; j++){if (arr[i] > arr[j]){int tmp = arr[i];arr[i] = arr[j];arr[j] = tmp;}}}cout << "排序后: " << endl;for (int i = 0; i < 9; i++){cout << arr[i] << " ";}cout << endl;return 0;
}