結果

問題 No.264 じゃんけん
ユーザー dododondon111
提出日時 2017-03-17 10:10:34
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 275 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 27,904 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-04 13:40:28
合計ジャッジ時間 778 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:9:11: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    9 |   else if(abs(me-you)==1&&me<you) printf("Won");
      |           ^~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 

ソースコード

diff #

#include<stdio.h>

int main(){
  int me,you;

  scanf("%d %d",&me,&you);

  if(me==you) printf("Drew");
  else if(abs(me-you)==1&&me<you) printf("Won");
  else if(abs(me-you)==1&&me>you) printf("Lost");
  else if(me>you) printf("Won");
  else printf("Lost");

  return 0;


}
0