結果

問題 No.8032 Unavailability of Inequality Signs
ユーザー Mister
提出日時 2020-08-01 11:04:31
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 431 bytes
コンパイル時間 935 ms
コンパイル使用メモリ 65,024 KB
最終ジャッジ日時 2025-01-12 12:26:33
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 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