// 32_32-1.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	int tuki;
	cout << "月を入力してください: ";
	cin >> tuki;

	try {
		if (tuki < 1) throw 1;
		if (tuki > 12) throw 2;
	}
	catch (int n) {
		if (n == 1) {
			cout << "エラー:月が1より小さい\n";
		}
		if (n == 2) {
			cout << "エラー:月が12より大きい\n";
		}
		MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);
		return 1;
	}
	cout << "月 = " << tuki << '\n';

	MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);

	return 0;
}

