結果

問題 No.222 引き算と足し算
ユーザー gu_21816943gu_21816943
提出日時 2017-06-28 22:18:35
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 710 bytes
コンパイル時間 1,757 ms
コンパイル使用メモリ 74,408 KB
実行使用メモリ 51,404 KB
最終ジャッジ日時 2024-04-15 04:09:34
合計ジャッジ時間 4,734 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
49,948 KB
testcase_01 AC 51 ms
50,156 KB
testcase_02 AC 51 ms
50,020 KB
testcase_03 AC 50 ms
50,508 KB
testcase_04 AC 50 ms
50,308 KB
testcase_05 AC 49 ms
50,172 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 51 ms
50,512 KB
testcase_10 AC 50 ms
50,376 KB
testcase_11 AC 52 ms
50,568 KB
testcase_12 RE -
testcase_13 AC 51 ms
50,048 KB
testcase_14 RE -
testcase_15 AC 58 ms
50,232 KB
testcase_16 AC 57 ms
50,548 KB
testcase_17 AC 56 ms
50,112 KB
testcase_18 RE -
testcase_19 AC 50 ms
50,580 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 52 ms
50,392 KB
testcase_24 RE -
testcase_25 AC 54 ms
50,516 KB
testcase_26 AC 51 ms
50,484 KB
testcase_27 RE -
testcase_28 AC 52 ms
50,564 KB
testcase_29 RE -
testcase_30 AC 52 ms
50,424 KB
testcase_31 AC 52 ms
50,468 KB
testcase_32 AC 52 ms
50,400 KB
testcase_33 AC 52 ms
50,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

class Main {
	static PrintWriter out = new PrintWriter(System.out);
	static String str;

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		br.close();

		int index = str.indexOf("+");
		if (index > 0) {
			System.out.println(Integer.parseInt(str.substring(0, index)) - Integer.parseInt(str.substring(index + 1)));
		}else{
			index=str.indexOf("-");
			System.out.println(Integer.parseInt(str.substring(0, index)) + Integer.parseInt(str.substring(index + 1)));
		}
	}
}
0