結果

問題 No.779 Heisei
ユーザー yuasa0000yuasa0000
提出日時 2019-02-18 14:41:48
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,643 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 56,464 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 22:37:16
合計ジャッジ時間 1,063 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>

int main() {
	int Y;
	int M;
	int D;

	bool FlagA = false;
	bool FlagB = false;
	bool FlagC = false;

	while (FlagA == false) {
		std::cout << "a" << std::endl;
		std::cin >> Y;
		if (Y >= 1969 && Y <= 2038)FlagA = true;
	}

	while (FlagB == false) {
		std::cout << "b" << std::endl;
		std::cin >> M;
		if (M >= 1 && M <= 12) {
			if (Y == 1969 && M == 12)FlagB = true;
			else if (Y == 2038 && M <= 4)FlagB = true;
			else if (Y >= 1970 && Y <= 2037)FlagB = true;
		}
	}

	while (FlagC == false) {
		std::cout << "c" << std::endl;
		std::cin >> D;
		switch (M) {
		case 1:
			if (D >= 1 && D <= 31)FlagC = true;
			break;

		case 2:
			if (D >= 1 && D <= 27)FlagC = true;
			break;

		case 3:
			if (D >= 1 && D <= 31)FlagC = true;
			break;

		case 4:
			if (D >= 1 && D <= 30)FlagC = true;
			break;

		case 5:
			if (D >= 1 && D <= 31)FlagC = true;
			break;

		case 6:
			if (D >= 1 && D <= 30)FlagC = true;
			break;

		case 7:
			if (D >= 1 && D <= 31)FlagC = true;
			break;

		case 8:
			if (D >= 1 && D <= 31)FlagC = true;
			break;

		case 9:
			if (D >= 1 && D <= 30)FlagC = true;
			break;

		case 10:
			if (D >= 1 && D <= 31)FlagC = true;
			break;

		case 11:
			if (D >= 1 && D <= 30)FlagC = true;
			break;

		case 12:
			if (D >= 1 && D <= 31)FlagC = true;
			break;
		}
	}

	bool hantei;

	if (Y >= 1989 && Y <= 2019) {
		if (Y == 1989 && M == 1 && M >= 8)hantei = true;
		if (Y == 2019 && M <= 4)hantei = true;
		if (Y >= 1990 && Y <= 2018)hantei = true;
	}

	else hantei = false;

	if (hantei == true)std::cout << "Yes" << std::endl;
	if (hantei == false)std::cout << "No" << std::endl;

	return 0;
}
0