大神帮忙看看结果为什么不对
#include <stdio.h>
int Sum(int score[])
{int i,sum;
for(i=0,sum=0;i<10;i++)
{
sum+=score[i];
}
printf("成绩总分为%d\n",sum);
return sum;
}
int Max(int score[])
{
int i,max;
for(i=0;i<9;i++){
if(max<=score[i]){
max=score[i];
}
}
printf("成绩最高分为%d\n",max);
return max;
}
int Min(int score[])
{
int i,min;
for(i=0;i<9;i++){
if(min>=score[i]){
min=score[i];
}
}
printf("成绩最低分为%d\n",min);
return min;
}
int Avg(int score[],int n)
{int i,sum,avg;
for(i=0;i<10;i++)
{
sum+=score[i];
} avg=sum/n;
printf("成绩平均分为%d\n",avg);
return avg;
}
int Order(int score[])
{
int i,j,temp;
if(i!=9){printf("%d\n,",score[i]);}
else{printf("%d\n",score);}
for(i=8;i>=0;i--){
for(j=0;j<=i;j++)
if(score[j]<=score[j+1]){
temp=score[j];
score[j]=score[j+1];
score[j+1]=temp;
}
}return 0;
}
int main()
{
int score[]={67,98,75,63,82,79,81,91,66,84};
Sum(score);
Max(score);
Min(score);
Avg(score,10);
Order(score);
int i;
for(i=0;i<10;i++){
if(i!=9){
printf("%d\n,",score[i]);
}else{
printf("%d\n",score[i]);
}
}
return 0;
}