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: 6ms
Memory: 1092kB
Author: 2018212212172
In contest: 1273

#include<stdio.h>
int main()
{
	int y,m,d;
	int center=0;
	int year=0;
	int week=0;


	while(scanf("%d %d %d",&y,&m,&d)!=EOF)
	{
		if(m==1||m==2)
		{
			y--;
			m+=12;
		}
		center=y/100;
		year=y-center*100;
		week=year+year/4+center/4-2*center+26*(m+1)/10+d-1;
		while(week<0)
			week=week+7;
		week=week%7;
		switch(week)
		{
		case 1:printf("Monday\n");break;
		case 2:printf("Tuesday\n");break;
		case 3:printf("Wednesday\n");break;
		case 4:printf("Thursday\n");break;
		case 5:printf("Friday\n");break;
		case 6:printf("Saturday\n");break;
		case 0:printf("Sunday\n");break;
		}
	}
	return 0;


}