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