結果

問題 No.264 じゃんけん
ユーザー matsuyoshi30matsuyoshi30
提出日時 2015-12-29 02:58:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 1,204 bytes
コンパイル時間 2,270 ms
コンパイル使用メモリ 74,636 KB
実行使用メモリ 57,580 KB
最終ジャッジ日時 2023-10-19 12:18:54
合計ジャッジ時間 3,984 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
57,416 KB
testcase_01 AC 126 ms
57,148 KB
testcase_02 AC 124 ms
57,580 KB
testcase_03 AC 121 ms
57,472 KB
testcase_04 AC 123 ms
57,568 KB
testcase_05 AC 128 ms
55,496 KB
testcase_06 AC 125 ms
57,556 KB
testcase_07 AC 114 ms
54,128 KB
testcase_08 AC 126 ms
57,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str1 = in.next();
        String str2 = in.next();
        int n1 = Integer.parseInt(str1);
        int n2 = Integer.parseInt(str2);
        switch(n1) {
            case 0:
                if(n2 == 0) {
                    System.out.println("Drew");
                } else if(n2 == 1) {
                    System.out.println("Won");
                } else {
                    System.out.println("Lost");
                }
                break;
            case 1:
                if(n2 == 0) {
                    System.out.println("Lost");
                } else if(n2 == 1) {
                    System.out.println("Drew");
                } else {
                    System.out.println("Won");
                }
                break;
            case 2:
                if(n2 == 0) {
                    System.out.println("Won");
                } else if(n2 == 1) {
                    System.out.println("Lost");
                } else {
                    System.out.println("Drew");
                }
                break;
        }
    }
}
0