模拟试题

3773考试网计算机等级考试模拟试题正文

2014年3月全国计算机二级C语言上机模拟试题五十八4

来源:2exam.com 2013-11-13 11:21:45

解题思路: 

  本题是计算平均成绩,再把低于平均成绩的分数存入依次数组below中。 

  参考答案: 

  int fun(int score[], int m, int below[]) 

  { 

  float av=0.0 ; 

  int i, j=0 ; 

  for(i=0; i  av /= m; 

  for(i=0; i  if(av>score[i]) below[j++]=score[i]; 

  return j; 

  } 

  ※※※※※※※※※※※※※※※※※※※※※※※※※ 

触屏版 电脑版
3773考试网 琼ICP备12003406号-1