// 选择排序 *源代码 // 选择排序 源代码 void ChooseSort(int *a,int n){ int i=-1,j,temp; for(;++i<n-1;){ temp=i; for(j=i;++j<n;){ if(a[temp]>a[j]){ temp=j; } } if(i!=temp){ swap(&a[i],&a[temp]); } } }