結果

問題 No.264 じゃんけん
ユーザー rf141rf141
提出日時 2015-08-07 23:09:07
言語 Java19
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 577 bytes
コンパイル時間 3,711 ms
コンパイル使用メモリ 73,640 KB
実行使用メモリ 39,472 KB
最終ジャッジ日時 2023-09-25 06:16:41
合計ジャッジ時間 5,681 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
39,472 KB
testcase_01 AC 118 ms
39,152 KB
testcase_02 AC 120 ms
39,356 KB
testcase_03 AC 120 ms
39,364 KB
testcase_04 AC 118 ms
39,464 KB
testcase_05 AC 118 ms
39,136 KB
testcase_06 AC 119 ms
39,072 KB
testcase_07 AC 123 ms
39,064 KB
testcase_08 AC 118 ms
39,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class janken{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		int me = scan.nextInt();
		int you = scan.nextInt();
		System.out.println(DOjanken(me,you));
	}
	public static String DOjanken(int m,int y){
		if(m==y)return "Drew";
		String result = "";
		switch(m){
			case 0:
				if(y==2)result="Lost";
				if(y==1)result="Won";
				break;
			case 1:
				if(y==0)result="Lost";
				if(y==2)result="Won";
				break;
			case 2:
				if(y==0)result="Won";
				if(y==1)result="Lost";
				break;
		}
		return result;
	}
}
0