2 条题解

  • 0
    @ 2024-10-21 9:29:23

    #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int re(char ch) { return 'Z' - ch + 1;//Z的ascll码值为90,A到Z是65到90递增,例如A的位置,就可以用90-65+1=26来计算,这样到Z就是递减了 }

    int main() { int t; char a, b; scanf("%d", &t); while (t--) { scanf(" %c %c", &a, &b); // 注意%c前的空格跳过空白字符 int A = re(a); int B = re(b); if (A > B) { printf("%c>%c\n", a, b); } else if (A < B) { printf("%c<%c\n", a, b); } else { printf("%c=%c\n", a, b); } } return 0; }

    信息

    ID
    196
    时间
    3000ms
    内存
    128MiB
    难度
    5
    标签
    (无)
    递交数
    676
    已通过
    259
    上传者