結果
問題 | No.201 yukicoderじゃんけん |
ユーザー |
|
提出日時 | 2017-03-17 15:48:21 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 474 bytes |
コンパイル時間 | 100 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 13:41:52 |
合計ジャッジ時間 | 701 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
コンパイルメッセージ
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=0;i<L0;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==L0-1) printf("-1\n"); } } return 0; }