大神们这样也可以吗
#include <stdio.h>
int main()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
int i;
int sum=0;
for(i=0;i<10;i++)
{
sum += score[i];
}
int average=sum/i;
printf("班级总分:%d\n",sum);
printf("班级平均分:%d\n",average);
int j;
for(j=9;j>0;j--)
{
for(i=0;i<j;i++)
{
if(score[i]<score[i+1])
{
int temp;
temp=score[i];
score[i]=score[i+1];
score[i+1]=temp;
}
}
}
for(i=0;i<10;i++)
{
if(i != 9)
printf("%d, ", score[i]);
else
printf("%d", score[i]);
}
return 0;
}