結果

問題 No.779 Heisei
ユーザー Fre_de_ricaFre_de_rica
提出日時 2019-02-20 23:08:23
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 905 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 28,544 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 11:31:29
合計ジャッジ時間 1,072 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 WA -
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define H_START 19890108        //平成の始まり
#define H_END 20190430          //平成の終わり



int main(void) {

	char year[5];
	char month[3];
	char day[3];

	char input_ymd[12];
	char output_ymd[12];

	int int_ymd;

	char *space_tp = NULL;

	//標準入力
	scanf("%[^\n]", &input_ymd);

	//スペース区切りで年月日を取得
	//年取り出し
	space_tp = strtok(input_ymd, " ");
	sprintf(year, "%s", space_tp);

	//月取り出し
	space_tp = strtok(NULL, " ");
	sprintf(month, "%02s", space_tp);

	//日取り出し
	space_tp = strtok(NULL, " ");
	sprintf(day, "%02s", space_tp);

	//年月日作成
	sprintf(output_ymd, "%s%s%s", year, month, day);

	//int型に変換
	int_ymd = atoi(output_ymd);

	//判定
	if (int_ymd < H_START || int_ymd >H_END) {
		printf("No\n");
	}
	else {
		printf("Yes\n");
	}

	return 0;

}
0