#GESP4227. [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;