結果

問題 No.8032 Unavailability of Inequality Signs
ユーザー Mister
提出日時 2020-08-01 10:59:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 639 ms
コンパイル使用メモリ 65,416 KB
最終ジャッジ日時 2025-01-12 12:26:20
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     std::scanf("%d", &n);
      |     ~~~~~~~~~~^~~~~~~~~~
main.cpp:12:19: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |         std::scanf("%d %d", &a, &b);
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <iostream>

constexpr char lt = 60;
constexpr char gt = 62;

int main() {
    int n;
    std::scanf("%d", &n);

    while (n--) {
        int a, b;
        std::scanf("%d %d", &a, &b);

        if (a == b) {
            std::putchar('=');
        } else if (std::min(a - b, 0) == 0) {
            std::putchar(gt);
        } else {
            std::putchar(lt);
        }
        std::putchar('\n');
    }
    return 0;
}
0