結果

問題 No.383 レーティング
ユーザー yamax3232yamax3232
提出日時 2017-02-15 20:13:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 3,360 ms
コンパイル使用メモリ 73,496 KB
実行使用メモリ 56,312 KB
最終ジャッジ日時 2023-08-28 17:26:57
合計ジャッジ時間 5,428 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
56,244 KB
testcase_01 AC 116 ms
55,860 KB
testcase_02 AC 114 ms
55,860 KB
testcase_03 AC 116 ms
55,944 KB
testcase_04 AC 117 ms
55,744 KB
testcase_05 AC 117 ms
55,756 KB
testcase_06 AC 116 ms
55,992 KB
testcase_07 AC 118 ms
54,720 KB
testcase_08 AC 117 ms
55,796 KB
testcase_09 AC 116 ms
56,312 KB
testcase_10 AC 116 ms
55,936 KB
testcase_11 AC 116 ms
56,236 KB
testcase_12 AC 116 ms
56,088 KB
testcase_13 AC 117 ms
56,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Rating {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
Scanner kb=new Scanner(System.in);
int a=kb.nextInt(),b=kb.nextInt();
if(a<b){
	System.out.print("+");
}else if(a>b){
	System.out.print("-");
	b*=-1;
	a*=-1;
}else{
	System.out.print("0");
}

if(a!=b){
System.out.printf("%d",b-a);
}
kb.close();
	}

}
0