#include <stdio.h>
int i,j;
int sortscore(int socre[])
{
int temp;
for(i=0;i<10;i++)
{
for(j=i+1;j<10;j++)
{
if(score[i]<score[j])
temp=score[i];
score[i]=score[j];
socre[j]=temp;
}
return socre;
}
}
int sumscore(int score[])
{
for(i=;i<10;i++)
{
sum+=score[i];
}
return sum;
printf("考试成绩总分为:%d\n",sum);
}
int maxscore(int score[]){
printf("最高分为:%d\n",score[N-1]);
}
int minscore(int score[]){
printf("最低分为:%d\n",score[0]);
}
int avagerscore(int score[]){
int avager;
avager=sum/N;
printf("平均分为:%d\n",avager);
}
int main()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
sortscore(score);
sumscore(score);
maxscore(score);
minscore(score);
avagerscore(score);
printf("考试成绩降序排序为%d\n",score[]);
return 0;
}
hello.c: In function 'sortscore': hello.c:10:16: error: 'score' undeclared (first use in this function) if(score[i]
有个地方没写上,
而且,你的排序是从大到小,最大值和最小值出错了