#include "stdio.h"
#define N 10
int main(int argc,char *argv[]){
int a[N],i,j,k;
printf("Please enter %d integer(s)...\n",N);
for(i=0;i printf("\nAfter ascending sort of output:\n"); for(i=0;i for(k=i,j=k+1;j if(a[k]>a[j]) k=j; if(k!=i) j=a[k],a[k]=a[i],a[i]=j; printf("%d ",a[i]); } printf("\n"); return 0; } 代码和运行样例图片: