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: 7ms
Memory: 1712kB
Author: 2017212212209
In contest: 1273

#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
int main()
{
	int y, m, d;
	while (scanf("%d %d %d", &y, &m, &d) != EOF)
	{
		if (m == 1 || m == 2)
		{
			m += 12;
			y--;
		}
		int day = (d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 100 + y / 400) % 7;
		if (day == 0)
		{
			printf("Monday\n");
		}
		else if (day == 1)
		{
			printf("Tuesday\n");
		}
		else if (day == 2)
		{
			printf("Wednesday\n");
		}
		else if (day == 3)
		{
			printf("Thursday\n");
		}
		else if (day == 4)
		{
			printf("Friday\n");
		}
		else if (day == 5)
		{
			printf("Saturday\n");
		}
		else
		{
			printf("Sunday\n");
		}
	}
	return 0;
}