某学校举办“校园演讲比赛力,每位选手由 位评委打分(分数为 0-10的整数),且每位评委必须打分。 计分规则:去掉一个最高分,去掉一个最低分。如下程序通过键盘先输入选手编号,然后依次输入 个分数,并计 算最终得分。下列说法正确的是( ) for (int i = 0; i score) min_score = score; total_score += score; } total_score = total_score - max_score - min_score; printf("%d号选手的成绩: 去掉一个最高分%d, 去掉一个最低分%d, 最后成绩是: %d", id, max_score, min_score, total_score);
A:上述代码能完成题目要求
B:max_score = 0, min_score = 100 应修改为 max_score = 0, min_score = 0
C:max_score score 必须相应修改为 =
D:total_score = total_score - max_score - min_score 不能达到预期,可修改如下:int total = total_score - max_score - min_score; total_score = total;
正确答案:A
试卷来源:202606 CCF-GESP编程能力等级认证C++二级真题