S004-AC.cc 686 Bytes
#include <iostream>

using namespace std;

int main()
{
	int d,m,a;

	while(1)
	{
		cin >> d;
		if(cin.eof())
		{
			return 0;
		}
		cin >> m;
		cin >> a;
		if(d <= 0 || d >= 32 || (m == 2 && d >= 30))
		{
			goto incorrect;
		}
		if(m <= 0 || m >= 13)
		{
			goto incorrect;
		}
		if(d == 31 && (m == 4 || m == 6 || m == 9 ||  m == 11))
		{
			goto incorrect;
		}
		if(a - (a/100)*100)
		{
			if((a % 4 != 0) && m == 2 && d == 29)
			{
				goto incorrect;
			}

		}
		else
		{
			if(((a/100) % 4 != 0) && m == 2 && d == 29)
			{
				goto incorrect;
			}
		}
		goto correct;
		incorrect:
		cout << "Incorrect Date" << endl;
		continue;
		correct:
		cout << "Correct Date" << endl;
	}
}