結果

問題 No.383 レーティング
ユーザー misk703misk703
提出日時 2018-06-05 11:38:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 3,182 ms
コンパイル使用メモリ 73,792 KB
実行使用メモリ 57,312 KB
最終ジャッジ日時 2023-09-12 22:23:47
合計ジャッジ時間 6,773 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 156 ms
56,752 KB
testcase_01 AC 156 ms
57,060 KB
testcase_02 AC 156 ms
56,756 KB
testcase_03 AC 157 ms
56,876 KB
testcase_04 AC 156 ms
56,404 KB
testcase_05 AC 157 ms
56,892 KB
testcase_06 AC 157 ms
57,004 KB
testcase_07 AC 154 ms
56,704 KB
testcase_08 AC 155 ms
56,736 KB
testcase_09 AC 154 ms
56,716 KB
testcase_10 AC 158 ms
57,312 KB
testcase_11 AC 154 ms
56,772 KB
testcase_12 AC 154 ms
56,840 KB
testcase_13 AC 151 ms
56,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No383 {

    public static void main(String[] args) {
	Scanner s = new Scanner(System.in);
	int a = s.nextInt();
	int b = s.nextInt();
	int ans = a-b;
	String plamai;
	if(ans < 0){
	    plamai = "+";
	    ans = Math.abs(ans);
	}else if(ans > 0){
	    plamai = "-";
	}else{
	    plamai = "";
	}

	System.out.println(plamai + ans);
    }

}
0