求高于平均分的学生学号及成绩
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);
}
版权声明:此文自动收集于网络,若有来源错误或者侵犯您的合法权益,您可通过邮箱与我们取得联系,我们将及时进行处理。
本文地址:https://www.gunzhua.com/jiuye/bishi/34253.html