2013年计算机二级C语言上机题库十九

考试站(www.examzz.com)   【考试站:中国教育考试第一门户】   2013年4月25日

为方便广大考生更好的复习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 += 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)

 


首页 1 2 3 尾页

相关文章