为方便广大考生更好的复习2013年计算机二级C语言考试,查找考试辅导习题,网校特提供了C语言上机预测题(填空题、改错题、编程题),更多模拟无纸化考试“计算机二级C语言模拟题”,供考生学习。
填空题
给定程序的功能是计算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 /= (float)m;
for (i=0; i
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
}
第1处填空:score[i]或*(score+i)
第2处填空:below
第3处填空:below[i]或*(below+i)