#includeusing namespace std;void swap(int* a,int* b){ int temp=*a; *a=*b; *b=temp;}void main(){ int a[]={2,5,3,7,4,8,2,6,2,4,10}; int length=sizeof(a)/sizeof(int); int gap=length/2; int i; int j; while(gap>=1) { for(i=0;i gap&&a[temp]
本文共 319 字,大约阅读时间需要 1 分钟。
#includeusing namespace std;void swap(int* a,int* b){ int temp=*a; *a=*b; *b=temp;}void main(){ int a[]={2,5,3,7,4,8,2,6,2,4,10}; int length=sizeof(a)/sizeof(int); int gap=length/2; int i; int j; while(gap>=1) { for(i=0;i gap&&a[temp]
转载于:https://www.cnblogs.com/james1207/p/3278391.html