4343: GESP C++ 三级_4进制判断202309

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:2 解决:2

题目描述

样例输入 复制

2
15A6F
1011

样例输出 复制

0 0 0 1
1 1 1 1

提示

#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];
        cout << (max <= '1') << " " << (max <= '7') << " " << (max <= '9') << " " <<(max <= 'F') << endl;
    }
    return 0;
}