int main()
{
float average(float array[10]);
float score[10], aver;
int i;
std::cout << "请输入10个数值:";
printf("\n");
for ( i = 0; i < 10; i++)
{
scanf("%f", &score[i]);
}
printf("\n");
aver = average(score);
printf("average score is %5.2f\n", aver);
return 0;
return 0;
}
float average(float array[10])
{
int i;
float aver, sum = 0;
for ( i = 0; i < 10; i++)
sum = sum + array[i];
aver = sum / 10;
return aver;
}