为什么我这个开头是91 其他全都对呢
#include <stdio.h>
int main()
{
int score[]={67,98,75,63,82,79,81,91,66,84};
int i,j;
int temp;
for (i=9;i>=0;i--)
{
for (j=0;j<9;j++)
{
if (score[i]<score[j])
{
temp=score[i];
score[i]=score[j];
score[j]=temp;
}
}
}
int sum=0;
int k;
for (k=0;k<10;k++)
{
sum=sum+score[k];
printf("%d ",score[k]);
}
printf("\nTotal score=%d\n",sum);
printf("Maximum score=%d\n",score[k-1]);
printf("Minimum score=%d\n",score[0]);
printf("Average score=%d\n",sum/10);
return 0;
}
结果 91 63 66 67 75 79 81 82 84 98 Total score=786 Maximum score=98 Minimum score=91 Average score=78