結果

問題 No.779 Heisei
コンテスト
ユーザー Fre_de_rica
提出日時 2019-02-20 23:25:21
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 803 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 126 ms
コンパイル使用メモリ 36,928 KB
最終ジャッジ日時 2026-02-22 02:30:05
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

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 <  19890108 || int_ymd > 20190430) {
		printf("No\n");
	}
	else {
		printf("Yes\n");
	}

	return 0;

}
0