結果

問題 No.264 じゃんけん
コンテスト
ユーザー phi_prog_8
提出日時 2015-08-07 22:38:25
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 0 ms / 5,000 ms
+ 646µs
コード長 438 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 73 ms
コンパイル使用メモリ 27,776 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-24 00:59:24
合計ジャッジ時間 1,656 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |   scanf("%d",&a);
      |   ^~~~~~~~~~~~~~
main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |   scanf("%d",&b);
      |   ^~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>
int main(void)
{
  int a,b;
  scanf("%d",&a);
  scanf("%d",&b);

  if (a==0) {
    if (b==0) printf("Drew\n");
    if (b==1) printf("Won\n");
    if (b==2) printf("Lost\n");
  }
    if (a==1) {
    if (b==0) printf("Lost\n");
    if (b==1) printf("Drew\n");
    if (b==2) printf("Won\n");
  }
  if (a==2) {
    if (b==0) printf("Won\n");
    if (b==1) printf("Lost\n");
    if (b==2) printf("Drew\n");
  }
  return 0;
}
0