結果

問題 No.3062 A + B
ユーザー kusagame12kusagame12
提出日時 2023-11-06 21:54:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 528 bytes
コンパイル時間 2,450 ms
コンパイル使用メモリ 76,300 KB
実行使用メモリ 57,660 KB
最終ジャッジ日時 2023-11-06 21:54:47
合計ジャッジ時間 4,432 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
57,620 KB
testcase_01 AC 129 ms
57,536 KB
testcase_02 AC 113 ms
56,292 KB
testcase_03 AC 120 ms
57,252 KB
testcase_04 AC 120 ms
57,508 KB
testcase_05 AC 110 ms
56,320 KB
testcase_06 AC 119 ms
57,660 KB
testcase_07 AC 121 ms
57,564 KB
testcase_08 AC 118 ms
55,448 KB
testcase_09 AC 120 ms
57,608 KB
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        String b = sc.next();
        
        String ans = "";
        if(a.equals("0")){
            ans = b;
        }else if(b.charAt(0) == '-'){
            ans = String.valueOf(Long.parseLong(a) + Long.parseLong(b));
        }else{
            ans = a + b;
        }
        
        System.out.println(ans);
    }
}
0