結果
問題 | No.264 じゃんけん |
ユーザー |
|
提出日時 | 2015-08-07 23:09:07 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 112 ms / 5,000 ms |
コード長 | 577 bytes |
コンパイル時間 | 3,022 ms |
コンパイル使用メモリ | 78,240 KB |
実行使用メモリ | 41,304 KB |
最終ジャッジ日時 | 2024-07-18 05:17:53 |
合計ジャッジ時間 | 4,340 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
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; } }