#include<stdio.h>
int main() {
int arr[10] = { 3,6,5,7,4,9,8,0,2,1 };
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10 - 1 - i; j++) {
if (arr[j] > arr[j + 1]) {
int tmp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = tmp;
}
}
}
for (int i = 0; i < 10; i++) {
printf("%d ", arr[i]);
}
return 0;
}
10-02
313
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)