第19套
填空题
给定程序的功能是计算SCORE中M个人的平均成绩AVER,将低于AVER的成绩放在BELOW中,通过函数名返回人数。
例如,当SCORE={10,20,30,40,50,60,70,80,90},M=9时,函数返回人数应该是4,BELOW={10,20,30,40}。
注意:部分源程序给出如下
请勿改动主函数main和其他函数中的任何内容,仅在横线上填入所编写的若干表达式或语句。
试题程序:#include
#include
int fun(int score[], int m, int below[])
{
int i, j = 0;
float aver = 0.0;
for (i=0; i
aver += score[i];
aver /= (float)m;
for (i=0; i
if (score[i] < aver)
below[j++] = ___1___;
return j;
}
main()
{
int i, n, below[9];
int score[9] = {10, 20, 30, 40, 50, 60, 70, 80, 90};
n = fun(score, 9, ___2___);
printf("\nBelow the average score are: ");
for (i=0; i
printf("%d ", ___3___);
}
第1处填空:score[i]或*(score+i)
第2处填空:below
第3处填空:below[i]或*(below+i)