結果
問題 | No.201 yukicoderじゃんけん |
ユーザー |
|
提出日時 | 2017-03-17 15:42:39 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 472 bytes |
コンパイル時間 | 129 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 13:41:49 |
合計ジャッジ時間 | 1,023 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 WA * 3 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:10:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%s %s %c",s[i],p[i],&x[i]); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>#include <string.h>int main(void){int L0,L1,i;char s[2][101],p[2][10001],x[2];for (i = 0;i < 2;i++) {scanf("%s %s %c",s[i],p[i],&x[i]);}L0=strlen(p[0]);L1=strlen(p[1]);if(L0>L1) printf("%s\n",s[0]);else if(L0<L1) printf("%s\n",s[1]);else{for(i=L0;i>=0;i--){if(p[0][i]>p[1][i]){ printf("%s\n",s[0]);break;}else if(p[0][i]<p[1][i]){ printf("%s\n",s[1]);break;}else if(i==0) printf("-1\n");}}return 0;}