笔记
冒泡排序
#include<stdio.h>
int main(void){
int i ,j ,temp;
int a[10] = {2,9,4,11,8,3,1,65,33,44};
for(i=0;i<10-1;i++){
for(j=0;j<10-1-i;j++){
if(a[j]>a[j+1]){
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
}
printf("after:\n");
for(i=0;i<10;i++)
printf("%d ",a[i]);
return 0;
}