#include<stdio.h>
#include<stdlib.h>
#include<math.h>
void Sort(int A[],int n){
int temp,j=0;
while(j<=6){
for(int i=n-1;i>j;i--){
if(A[i]<A[i-1]){
temp=A[i];
A[i]=A[i-1];
A[i-1]=temp;
}
}
j++;
}
}
int main(){
int A[16]={16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
int n=16;
Sort(A,n);
printf("%d\n",A[7-1]);
return 0;
}
8.3交换排序综合应用5
最新推荐文章于 2024-09-14 17:18:21 发布