请问为什么我的总分和平均分显示不出来?
#include <stdio.h>
#define N
int allScore(int score[])
{
int i;
int sum = 0;
for (i = 0; i<10; i++)
{
sum += score[i];
return sum;
}
printf("学生的总分为%d\n", sum);
printf("学生平均分为%d\n", sum / 10);
return 0;
}
int maxminScore(int score[])
{
int i, j, k;
for (i = 9; i>0; i--)
{
for (j = 0; j<i; j++)
{
if (score[j]<score[j + 1])
{
k = score[j];
score[j] = score[j + 1];
score[j + 1] = k;
}
}
}
printf("学生最高分%d\n", score[0]);
printf("学生最低分%d\n", score[9]);
for (i = 0; i<10; i++)
{
printf("%d\n", score[i]);
}
return 0;
}
int main()
{
int score[N] = { 67,98,75,63,82,79,81,91,66,84 };
allScore(score);
maxminScore(score);
return 0;
}