結果

問題 No.383 レーティング
ユーザー misk703
提出日時 2018-06-05 11:38:13
言語 Java
(openjdk 23)
結果
AC  
実行時間 164 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 3,399 ms
コンパイル使用メモリ 76,860 KB
実行使用メモリ 42,604 KB
最終ジャッジ日時 2024-06-30 09:53:51
合計ジャッジ時間 6,410 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

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