首页 > 就业 > 笔试

求高于平均分的学生学号及成绩

求高于平均分的学生学号及成绩



求高于平均分的学生学号及成绩

  double find(int total, int n) {

  int number, score, average;

  scanf(“%d”, &number);

  if(number != 0) {

  scanf(“%d”, &score);

  average = find(total+score, n+1);

  if(score >= average)

  printf(“%d:%d\n”, number, score);

  return average;

  } else {

  printf(“Average=%d\n”, total/n);

  return total/n;

  }

  }

  int main(int argc, char* argv[]) {

  find(0, 0);

  }

相关内容

热门阅读
随机推荐