Start: Jun, 26, 2019 08:30:00
2019年度暑期短学期第一天
End: Jun, 26, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 22ms
Memory: 1712kB
Author: project2501
In contest: 1273

#include<iostream>
using namespace std;

int main()
{
	int y,m,d;
	while (cin >> y >> m >> d)
	{
		int w,c;
		if (m==1||m==2)
		{
			m+=12;
			y--;
		}
		c=y/100;
		y=y%100;
		w=(y+y/4+c/4-2*c+26*(m+1)/10+d-1);
		//cout << w;
		w=(w%7+7)%7;
		switch(w)
		{
			case(0):
				cout << "Sunday"<<endl;
				break;
			case(1):
				cout << "Monday" <<endl;
				break;
			case(2):
				cout << "Tuesday" <<endl;
				break;
			case(3):
				cout << "Wednesday" <<endl;
				break;
			case(4):
				cout << "Thursday" <<endl;
				break;
			case(5):
				cout << "Friday" <<endl;
				break;
			case(6):
				cout << "Saturday" <<endl;
				break;	
		}
	}
}