代码如下:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int score = 0, sum = 0, max = 0, min = 100, count = 0, aver = 0;
printf("请输入学生成绩:");
scanf("%d", &score);
while (score >= 0 && score <= 100) {
sum += score;
if (score > max) {
max = score;
}
if (score < min) {
min = score;
}
count++;
scanf("%d", &score);
}
printf("共录入了 %d 个学生成绩。\n", count);
printf("最高分:%d\n", max);
printf("最低分:%d\n", min);
printf("平均分:%d\n", sum / count);
system("pause");
return 0;
}
追问程序第七行有问题哎
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/48540923dd54564e50c00494bfde9c82d0584ff2?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
追答你是不是写错了,在我这里没有问题的。
追问我又检查了一遍,没有写错,就是有这个问题哎
追答你代码截个图
追问好的
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/0df431adcbef7609db0f743222dda3cc7cd99e13?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
追答scanf 那一行写错了, "%d" 后面应该是一个英文状态的逗号,你那个不是。
追问不好意思哈,谢谢您的解答