結果
| 問題 |
No.201 yukicoderじゃんけん
|
| コンテスト | |
| ユーザー |
umashika
|
| 提出日時 | 2016-02-01 19:51:54 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 717 bytes |
| コンパイル時間 | 200 ms |
| コンパイル使用メモリ | 21,632 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-21 19:51:01 |
| 合計ジャッジ時間 | 934 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 RE * 11 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:31:9: warning: ‘return’ with no value, in function returning non-void
31 | return;
| ^~~~~~
main.c:3:5: note: declared here
3 | int main(void)
| ^~~~
main.c:35:9: warning: ‘return’ with no value, in function returning non-void
35 | return;
| ^~~~~~
main.c:3:5: note: declared here
3 | int main(void)
| ^~~~
main.c:15:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
15 | scanf("%s %s %c",s1,p1,&x1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:16:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%s %s %c",s2,p2,&x2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<string.h>
int main(void)
{
char s1[101];
char s2[101];
//整数型では格納しきれない
//配列を用いる
char p1[100000];
char p2[100000];
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);
return;
}
else if(p1[i]<p2[i]){
printf("%s\n",s2);
return;
}
}
printf("-1\n");
}
return 0;
}
umashika