貌似没问题
#include <stdio.h>
int i,j,sum;
int zongfen(int score[10])
{
for(i=0;i<10;i++)
{
sum+=score[i];
}
printf("总分为:%d\n",sum);
}
int zuigaofen(int score[10])
{
for(i=9;i>=0;i--)
{
for(j=0;j<i;j++)
{
if(score[j]>score[j+1])
{
int da;
da=score[j];
score[j]=score[j+1];
score[j+1]=da;
}
}
}
printf("最高分为:%d\n",score[9]);
printf("最低分为:%d\n",score[0]);
printf("成绩降序排列:");
for(i=9;i>=0;i--)
{
if(i!=0)
{
printf("%d\t",score[i]);
}
else
{
printf("%d\n",score[i]);
}
}
}
int pingjun(int score[10])
{
printf("平均分是:%.2f\n",sum/10.0);
}
int main()
{
printf("hello\n");
int score[10]={67,98,75,63,82,79,81,91,66,84};
zongfen(score);
zuigaofen(score);
pingjun(score);
printf("结束");
return 0;
}