# include <stdio.h> void main() {int i,j,k1,k2; int a[10]; for(i=0;i<10;i++) scanf("%d",&a[i]); //输入10个数,空格隔开 for(i=0,k1=i,k2=i;i<9;i++) { for(j=i+1;j<10;j++) { if(a[k1]<a[j]) k1=j; if(a[k2]>a[j]) k2=j; } } printf("the max is %d and the local is %d\n",a[k1],k1+1); printf("the min is %d and the local is %d\n",a[k2],k2+1); }