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

#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int CaculateWeekDay(int y, int m, int d)
{
	if (m == 1 || m == 2) {
		m += 12;
		y--;
	}
	int iWeek = (d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 100 + y / 400) % 7;
	return iWeek + 1;
}
int main() 
{
	int a, b, c;
	while (cin >> a >> b >> c) 
	{
		int week = CaculateWeekDay(a, b, c);
		if (week == 1)
			printf("Monday\n");
		if (week == 2)
			printf("Tuesday\n");
		if (week == 3)
			printf("Wednesday\n");
		if (week == 4)
			printf("Thursday\n");
		if (week == 5)
			printf("Friday\n");
		if (week == 6)
			printf("Saturday\n");
		if (week == 7)
			printf("Sunday\n");
	}
	return 0;
}