#13977. [GESP202609 三级 C++] 第 9 题

[GESP202609 三级 C++] 第 9 题

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

#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;