摘要: 1、冒泡排序:每次把循环过程中最大的数放到最后,循环次数每次减一。 1 void BubbleSort(int a[],int length) 2 { 3 int i,temp,num; 4 for(num=length-1;num>0;num--) 5 { 6 for(i=0;i<num;i++) 7 { 8 if(a[i]>a[i+1]) 9 {10 temp=a[i];11 a[i]=a[i+1];12 ... 阅读全文
posted @ 2013-05-28 14:22 楠楠IT 阅读(1040) 评论(0) 推荐(0) 编辑