結果

問題 No.264 じゃんけん
ユーザー k__umek__ume
提出日時 2019-04-28 19:04:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 671 bytes
コンパイル時間 3,333 ms
コンパイル使用メモリ 71,536 KB
実行使用メモリ 49,376 KB
最終ジャッジ日時 2023-08-22 18:04:44
合計ジャッジ時間 4,320 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
49,220 KB
testcase_01 AC 40 ms
49,236 KB
testcase_02 AC 40 ms
49,236 KB
testcase_03 AC 40 ms
49,168 KB
testcase_04 AC 40 ms
49,180 KB
testcase_05 AC 40 ms
49,376 KB
testcase_06 AC 40 ms
49,136 KB
testcase_07 AC 40 ms
49,280 KB
testcase_08 AC 40 ms
49,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String... args) throws IOException {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            String line = reader.readLine();
            System.out.println(battle(line.charAt(0), line.charAt(2)));
        }
    }
    static String battle(char me, char you) {
        switch (me - you) {
            case -1:
            case 2:
                return "Won";
            case 0:
                return "Drew";
            default:
                return "Lost";
        }
    }
}
0