#include <stdio.h>
#define N 10
int Sum(int score[])
{
int i;
int sum;
for(i=0;i<N;i++)
{
sum=sum+score[i];
}
return sum;
}
int Max(int score[])
{
int max=-1;
int i;
for(i=0;i<N;i++)
{
if(score[i]>max)
{
max=score[i];
}
}
return max;
}
int Min(int score[])
{
int min=100;
int i;
for(i=0;i<N;i++)
{
if(score[i]<min)
{
min=score[i];
}
}
return min;
}
int main()
{
int score[N]={67,98,75,63,82,79,81,91,66,84};
int sum=Sum(score);
int max=Max(score);
int min=Min(score);
printf("%d\n",sum);
printf("%d\n",max);
printf("%d\n",min);
return 0;
定义sum=0试试