C code:
1 //对数组a[MAX]进行冒泡排序 2 void BubbleSort(int a[]) 3 { 4 int temp = 0; //临时变量 5 int i = 0; 6 for (i=0; ia[i+1]) 9 {10 temp = a[i];11 a[i] = a[i+1];12 a[i+1] = temp;13 }14 }15 }
本文共 334 字,大约阅读时间需要 1 分钟。
C code:
1 //对数组a[MAX]进行冒泡排序 2 void BubbleSort(int a[]) 3 { 4 int temp = 0; //临时变量 5 int i = 0; 6 for (i=0; ia[i+1]) 9 {10 temp = a[i];11 a[i] = a[i+1];12 a[i+1] = temp;13 }14 }15 }
转载于:https://www.cnblogs.com/nemowang1996/p/6534523.html