有人可以耐心看下代码错误吗
#include <stdio.h>
int sum(int score[10])
{
int sums,i;
for(i=0;i<10;i++)
{
sums+=score[i];
}
return sums;
}
int max(int score[10])
{
int maxs=0,i;
for(i=0;i<10;i++)
{
if (maxs<score[i])
{
maxs=score[i];
}
}
return maxs;
}
int min(int score[10])
{
int mins=max(score),i;
for(i=0;i<10;i++)
{
if (mins>score[i])
{
mins=score[i];
}
}
return mins;
}
int ave(int score[10])
{
int aves;
aves=(sum(score))/10;
return aves;
}
void a(int score[10])
{
int i,j,flag;
for(i=9;i>=0;i--)
{
for (j=0;j<=9;j++)
{
if (score[j]<score[j+1])
{
flag=score[j];
score[j]=score[j+1];
score[j+1]=flag;
}
}
}
for(i=0;i<10;i++)
{
if (i!=9)
{
printf("%d ",score[i]);
}
else
{
printf("%d\n",score[i]);
}
}
}
int main()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
printf("总分是%d\n",sum(score));
printf("最高分是%d\n",max(score));
printf("最低分是%d\n",min(score));
printf("平均分是%d\n",ave(score));
a(score);
return 0;
}