結果

問題 No.3032 Unavailability of Inequality Signs
ユーザー tentententen
提出日時 2021-09-01 08:16:16
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,317 bytes
コンパイル時間 2,041 ms
コンパイル使用メモリ 74,272 KB
実行使用メモリ 49,856 KB
最終ジャッジ日時 2023-08-18 03:35:59
合計ジャッジ時間 4,868 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        char left = (char)(62);
        char right = (char)(60);
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int ans = a - b;
            if (ans == 0) {
                sb.append("=");
            } else if (String.valueOf(ans).charAt(0) == '-') {
                sb.append(right);
            } else {
                sb.append(left);
            }
            sb.append("\n");
        }
        System.out.print(sb);
   }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public String next() throws Exception {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0