I. [GESP]L3-202609-Q4227-S

    客观题

[GESP]L3-202609-Q4227-S

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

下列程序是分别判断输入的 NN 个数是否可能是二进制、八进制、十进制、十六进制,横线处应该填入的是( )

#include <iostream>
using namespace std;
int main() {
    int n = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        char str[11];
        cin >> str;
        char max = '0';
        for (int i = 0; str[i] != '\0'; i++)
            if (str[i] > max)
                max = str[i];
        _____________________________
    }
    return 0;
}

{{ select(1) }}

  • cout << (max <= '1') << " " << (max <= '7') << " " << (max <= '9') << " " << (max <= 'F') << endl;
  • cout << (max <= 1) << " " << (max <= 7) << " " << (max <= 9) << " " << (max <= 'F') << endl;
  • cout << (max <= 1) << " " << (max <= 7) << " " << (max <= 9) << " " << (max <= F) << endl;
  • cout << (max >= 1) << " " << (max >= 7) << " " << (max >= 9) << " " << (max >= F) << endl;

GESP 2026.09 C++ 三级 全真模拟赛

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