出了点问题,求解,急!
为什么我的score[2]被吃了?
#include <stdio.h>
int main()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
int sum,average,N;
sum = 0;
for(N=0;N<10;N++)
{
sum += score[N];
}
printf("总分是%d\n",sum);
for(N=0;N<10;N++)
{
if(score[N]<score[N+1])
{
int temp;
temp=score[N+1];
score[N+1]=score[N];
score[N]=temp;
printf("score[%d]=%d\n",N,score[N]);
}
}
printf("最高分是%d\n",score[0]);
printf("最低分是%d\n",score[9]);
average=sum/10;
printf("平均分是%d\n",average);
return 0;
}