結果

問題 No.383 レーティング
ユーザー RinRin
提出日時 2016-09-09 11:32:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 3,661 ms
コンパイル使用メモリ 76,616 KB
実行使用メモリ 54,888 KB
最終ジャッジ日時 2024-04-27 22:27:09
合計ジャッジ時間 6,015 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
52,672 KB
testcase_01 AC 104 ms
52,776 KB
testcase_02 AC 113 ms
54,336 KB
testcase_03 AC 104 ms
52,840 KB
testcase_04 AC 106 ms
52,960 KB
testcase_05 AC 119 ms
53,876 KB
testcase_06 AC 123 ms
53,980 KB
testcase_07 AC 105 ms
53,216 KB
testcase_08 AC 100 ms
52,428 KB
testcase_09 AC 117 ms
54,456 KB
testcase_10 AC 119 ms
54,108 KB
testcase_11 AC 103 ms
54,888 KB
testcase_12 AC 107 ms
52,832 KB
testcase_13 AC 116 ms
54,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class b {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		String ansVal = Integer.toString(Math.abs(a - b));
		if(a > b){
			ansVal = "-" + ansVal;
		}else if(a < b){
			ansVal = "+" + ansVal;
		}
		System.out.println(ansVal);
	}
}
0