結果
問題 | No.264 じゃんけん |
ユーザー |
|
提出日時 | 2023-01-23 17:18:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 710 bytes |
コンパイル時間 | 301 ms |
コンパイル使用メモリ | 27,136 KB |
最終ジャッジ日時 | 2025-02-10 06:29:03 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:13:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%d%d",&me,&enemy); | ~~~~~^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> enum Hand { Rock, Scissors, Paper, }; int main(){ int me; int enemy; scanf("%d%d",&me,&enemy); if(me==Rock){ if(enemy==Rock){ printf("Drew"); }else if(enemy==Scissors){ printf("Won"); }else{ printf("Lost"); } }else if(me==Scissors){ if(enemy==Rock){ printf("Lost"); }else if(enemy==Scissors){ printf("Drew"); }else{ printf("Won"); } } else{ if(enemy==Rock){ printf("Won"); }else if(enemy==Scissors){ printf("Lost"); }else{ printf("Drew"); } } }