結果
| 問題 | No.779 Heisei |
| コンテスト | |
| ユーザー |
ganmodokix
|
| 提出日時 | 2019-10-19 18:00:57 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 398 bytes |
| 記録 | |
| コンパイル時間 | 119 ms |
| コンパイル使用メモリ | 27,520 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 14:21:37 |
| 合計ジャッジ時間 | 944 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
1 | d;
| ^
main.c:1:1: warning: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int]
2 | main(y,m) {
| ^~~~
main.c: In function 'main':
main.c:2:1: warning: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c:2:1: warning: type of 'm' defaults to 'int' [-Wimplicit-int]
main.c:3:5: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
3 | scanf("%d%d%d",&y,&m,&d);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | d;
main.c:3:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
3 | scanf("%d%d%d",&y,&m,&d);
| ^~~~~
main.c:3:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:9: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
5 | puts("No");
| ^~~~
main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'puts'
ソースコード
d;
main(y,m) {
scanf("%d%d%d",&y,&m,&d);
if (y < 1989 || 2019 < y) {
puts("No");
} else if (y == 1989) {
if (m == 1 && d < 8) {
puts("No");
} else {
puts("Yes");
}
} else if (y == 2019) {
if (m > 4) {
puts("No");
} else {
puts("Yes");
}
} else {
puts("Yes");
}
}
ganmodokix