为何这样实现不了降序?
#include<stdbool.h>
#include<stdio.h>
int main()
{int max,min,sum,average,paixu,temp,m,i,j,s;
int score[20]={67,98,75,63,82,79,81,91,66,84};
max=score[0];
min=score[0];
for(i=0;i<10;i++)
{
sum=sum+score[i];
if(score[i]>max)
max=score[i];
else if(score[i]<min)
min=score[i];
}
average=sum/10;
printf("总分:%d,最高分:%d,最低分:%d,平均分:%d,",sum,max,min,average);
for(m=8;m>=0;m--)
{
for(j=0;j<=m;j++)
{
if(score[j]<score[j+1])
temp=score[j];
score[j]=score[j+1];
score[j+1]=temp;
}
}
printf("降序");
for(s=0;s<10;s++)
{
printf(" %d",score[s]);
}
return 0;
}