#include "stdio.h"
int main(int argv,char *argc[]){
int a[10],i,m1,m2;
printf("Input 10 score:");
for(i=0;i<10;scanf("%d",a+i++));
printf("--------primary data--------\n");
for(m1=m2=i=0;i<10;i++){
printf("%d ",a[i]);
if(a[m1] m2=m1;
m1=i;
}
}
printf("\n========data exchange========\n");
i=a[9],a[9]=a[m1],a[m1]=i;
i=a[8],a[8]=a[m2],a[m2]=i;
for(i=0;i<10;printf("%d ",a[i++]));
printf("\n");
return 0;
}
运行样例: