O. [GESP]L2-202606-Q4005-S

    客观题

[GESP]L2-202606-Q4005-S

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

某学校举办“校园演讲比赛”,每位选手由 88 位评委打分(分数为 0∼1000 \sim 100 的整数),且每位评委必须打分。计分规则:去掉一个最高分,去掉一个最低分。如下程序通过键盘先输入选手编号,然后依次输入 88 个分数,并计算最终得分。下列说法正确的是( )。

for (int i = 0; i < 10; i++) {
    int id, score;
    printf("输入选手编号: ");
    scanf("%d", &id);
    int max_score = 0, min_score = 100; // 最高分和最低分
    int total_score = 0; // 总分
    for (int j = 1; j < 9; j++) {
        printf("输入选手第%d个成绩:", j);
        scanf("%d", &score);
        if (max_score < score)
            max_score = score;
        if (min_score > 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);
}

{{ select(1) }}

  • 上述代码能完成题目要求
  • max_score = 0, min_score = 100 应修改为 max_score = 0, min_score = 0
  • max_score < score 和 min_score > score 必须相应修改为 <= 和 >=
  • total_score = total_score - max_score - min_score 不能达到预期,可修改如下:int total = total_score - max_score - min_score; total_score = total;

GESP 2026.06 C++ 二级 全真模拟赛

未参加
状态
已结束
规则
OI
题目
27
开始于
2026-11-20 13:34
结束于
2026-11-25 13:34
持续时间
2 小时
主持人
参赛人数
0