int main() {
//定义一个数组
int a[]={3,5,1,4,9};
//冒泡排序
for (int i=0; i<5-1; i++) {
for (int j=0; j<5-1-i; j++) {
if (a[j]>a[j+1]) {
int t=a[j+1];
a[j+1]=a[j];
a[j]=t;
}
}
}
for (int i=0; i<5; i++) {
printf("%d\t",a[i]);
}
printf("\n");
return 0;
}