#include #include #include #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; }