void main() {
int score[N],i,j,k,num,max,min,t; float avg,sum;
printf("请输入%d个同学的成绩:",N); for(i=0;i<N;i++)
scanf("%d",&score[i]);
max=min=score[0]; sum=num=0; for(i=0;i<N;i++)
{ sum=sum+score[i];
if(score[i]<60) num=num+1; if(score[i]>max) max=score[i]; if(score[i]<min) min=score[i]; }
avg=sum/N;
printf("\n不及格的学生人数:%d\n",num); printf("\n全班的平均分:%.2f\n",avg);
printf("\n最高分: %d, 最低分: %d\n",max,min); for(i=0;i<N-1;i++) { k=i; for(j=i+1;j<N;j++)
if(score[j]>score[k]) k=j;
if(k!=i) { t=score[i]; score[i]=score[k]; score[k]=t; } }
printf("\n以下为全班同学的名次与成绩(从高到底):\n"); for(i=0;i<N;i++)
printf("第%d名,成绩:%d\n",i+1,score[i]); } 2. [1] &a[i][j] [2] a[i][0] [3] s[i]=a[i][j]