結果
問題 |
No.201 yukicoderじゃんけん
|
ユーザー |
![]() |
提出日時 | 2015-09-16 10:22:59 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 286 bytes |
コンパイル時間 | 91 ms |
コンパイル使用メモリ | 20,352 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 06:40:52 |
合計ジャッジ時間 | 906 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 15 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:13: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[100]’ [-Wformat=] 6 | scanf("%s %d %c %s %d %c", &SA, &PA, &XA, &SB, &PB, &XB); | ~^ ~~~ | | | | char * char (*)[100] main.c:6:22: warning: format ‘%s’ expects argument of type ‘char *’, but argument 5 has type ‘char (*)[100]’ [-Wformat=] 6 | scanf("%s %d %c %s %d %c", &SA, &PA, &XA, &SB, &PB, &XB); | ~^ ~~~ | | | | char * char (*)[100] main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%s %d %c %s %d %c", &SA, &PA, &XA, &SB, &PB, &XB); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void){ char SA[100], SB[100], XA, XB; int PA, PB; scanf("%s %d %c %s %d %c", &SA, &PA, &XA, &SB, &PB, &XB); if(PA>PB){ printf("%s\n", SA); }else if(PA==PB){ printf("-1\n"); }else{ printf("%s\n", SB); } return 0; }