結果
| 問題 |
No.138 化石のバージョン
|
| コンテスト | |
| ユーザー |
Haijinn
|
| 提出日時 | 2017-07-20 15:03:27 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 544 bytes |
| コンパイル時間 | 776 ms |
| コンパイル使用メモリ | 20,736 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-08 17:43:50 |
| 合計ジャッジ時間 | 1,820 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 WA * 4 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:1: warning: implicit declaration of function ‘gets’; did you mean ‘fgets’? [-Wimplicit-function-declaration]
8 | gets(s);
| ^~~~
| fgets
main.c:12:6: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration]
12 | a[0]=atoi(strtok(s,"."));
| ^~~~
/usr/bin/ld: /tmp/ccIZXHi1.o: in function `main':
main.c:(.text.startup+0x3e): 警告: the `gets' function is dangerous and should not be used.
ソースコード
#include<stdio.h>
#include<string.h>
int main(){
char s[1000];
char t[1000];
gets(s);
gets(t);
int b[3];
int a[3];
a[0]=atoi(strtok(s,"."));
a[1]=atoi(strtok(NULL,"."));
a[2]=atoi(strtok(NULL,"."));
b[0]=atoi(strtok(t,"."));
b[1]=atoi(strtok(NULL,"."));
b[2]=atoi(strtok(NULL,"."));
if(a[0]>b[0]){
printf("YES\n");
}else if(b[1]<a[1]&&a[0]==b[0]){
printf("YES\n");
}else if(a[2]>b[2]&&a[1]==b[1]&&a[0]==b[0]){
printf("YES\n");
}else{
printf("NO\n");
//printf("%d %dYES\n",a[2],b[2]);
}
return 0;
}
Haijinn