結果

問題 No.264 じゃんけん
ユーザー yugi0922yugi0922
提出日時 2020-06-20 14:57:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 5,000 ms
コード長 1,116 bytes
コンパイル時間 5,483 ms
コンパイル使用メモリ 74,116 KB
実行使用メモリ 56,228 KB
最終ジャッジ日時 2023-09-16 17:27:36
合計ジャッジ時間 6,739 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
55,464 KB
testcase_01 AC 116 ms
55,844 KB
testcase_02 AC 114 ms
55,732 KB
testcase_03 AC 113 ms
55,972 KB
testcase_04 AC 111 ms
56,228 KB
testcase_05 AC 112 ms
55,596 KB
testcase_06 AC 111 ms
55,672 KB
testcase_07 AC 110 ms
56,028 KB
testcase_08 AC 109 ms
55,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import static java.lang.System.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class JanKen {
	public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
		String[] inputs = reader.readLine().split(" ");
		String myHand = inputs[0];
		String enemyHand = inputs[1];
		String judge = "";
		if(myHand.equals("0")){
			switch(enemyHand){
				case "0":
					judge = "Drew";
					break;
				case "1":
					judge = "Won";
					break;
				case "2":
					judge = "Lost";
					break;

			}
		}
		if(myHand.equals("1")){
			switch(enemyHand){
				case "0":
					judge = "Lost";
					break;
				case "1":
					judge = "Drew";
					break;
				case "2":
					judge = "Won";
					break;

			}
		}
		if(myHand.equals("2")){
			switch(enemyHand){
				case "0":
					judge = "Won";
					break;
				case "1":
					judge = "Lost";
					break;
				case "2":
					judge = "Drew";
					break;

			}
		}
		System.out.println(judge);
	}
}
0