/**
* 归并排序}
1 /**
2 * 冒泡排序
3 */
4 #include<stdio.h>
5
6 int main()
7 {
8 int a[] = {2,4,62,567,78,12,23,3};
9 int len = sizeof(a)/sizeof(int);
10 int i=0, j=0, tmp=0 , isc=1;
11
12 for (; i < len ; i++){
13
14 if(isc ==0) { continue; }
15 isc=0;
16 for(j=0; j < len-i-1; j++)
17 {
18 if(a[j] > a[j+1]){
19 isc=1;
20 tmp = a[j];
21 a[j] = a[j+1];
22 a[j+1] = tmp;
23 }
24 }
25 }
26
27 for(i=0; i < len; i++){printf("%d\t",a[i]);}
28
29 printf("\n");
30 return 1;
31
32 }