結果

問題 No.264 じゃんけん
ユーザー nogisunnogisun
提出日時 2020-03-19 12:01:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 111 ms / 5,000 ms
コード長 976 bytes
コンパイル時間 3,369 ms
コンパイル使用メモリ 71,628 KB
実行使用メモリ 55,948 KB
最終ジャッジ日時 2023-08-20 20:45:21
合計ジャッジ時間 4,267 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
55,828 KB
testcase_01 AC 104 ms
55,812 KB
testcase_02 AC 105 ms
55,800 KB
testcase_03 AC 105 ms
55,268 KB
testcase_04 AC 106 ms
55,948 KB
testcase_05 AC 111 ms
55,832 KB
testcase_06 AC 104 ms
55,760 KB
testcase_07 AC 103 ms
55,696 KB
testcase_08 AC 106 ms
55,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No264{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int zibun = sc.nextInt();
        int aite = sc.nextInt();
        String result[][] = new String[3][3];
        for (int i=0; i<3; i++){
            for (int j=0; j<3; j++){
                switch (i-j+2){
                    case 4:
                        result[i][j] = "Won";
                        break;
                    case 3:
                        result[i][j] = "Lost";
                        break;
                    case 2:
                        result[i][j] = "Drew";
                        break;
                    case 1:
                        result[i][j] = "Won";
                        break;
                    case 0:
                        result[i][j] = "Lost";
                        break;
                }
            }
        }
        System.out.println(result[zibun][aite]);
    }
}
0