結果
| 問題 |
No.201 yukicoderじゃんけん
|
| コンテスト | |
| ユーザー |
umashika
|
| 提出日時 | 2016-02-01 20:11:58 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 652 bytes |
| コンパイル時間 | 95 ms |
| コンパイル使用メモリ | 20,864 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-21 19:51:18 |
| 合計ジャッジ時間 | 755 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 4 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:13:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%s %s %c",s1,p1,&x1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:14:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf("%s %s %c",s2,p2,&x2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<string.h>
int main(void)
{
char s1[101];
char s2[101];
char p1[1000000];
char p2[1000000];
int len_p1,len_p2;
char x1,x2;
int i;
scanf("%s %s %c",s1,p1,&x1);
scanf("%s %s %c",s2,p2,&x2);
len_p1=strlen(p1);
len_p2=strlen(p2);
if(len_p1 > len_p2){
printf("%s\n",s1);
}
else if(len_p1 < len_p2){
printf("%s\n",s2);
}
else{
for(i=0;i<len_p1;i++){
if(p1[i]>p2[i]){
printf("%s\n",s1);
break;
}
else if(p1[i]<p2[i]){
printf("%s\n",s2);
break;
}
else if(i == len_p1){
printf("-1\n");
}
}
}
return 0;
}
umashika