#include <stdio.h>
int main()
{
int score[]={67,98,75,63,82,79,81,91,66,84};
printf("总分:%d\n",getSum(score));
printf("最高分:%d\n",getBest(score));
printf("最低分:%d\n",getLowest(score));
printf("平均分:%f\n",getAverage(getSum(score)));
return 0;
}
int getSum(int arr[])
{
int i,sum=0;
for(i=0;i<10;i++)
{
sum=sum+arr[i];
}
return sum;
}
int getBest(int arr[])
{
int i,best=0;
for(i=0;i<10;i++)
{
if(arr[i]>best)
{
best=arr[i];
}
}
return best;
}
int getLowest(int arr[])
{
int i,lowest=100;
for(i=0;i<10;i++)
{
if(lowest>arr[i])
{
lowest=arr[i];
}
}
return lowest;
}
float getAverage(int sum)
{
float average=sum/10;
return average;
}
报了什么错?