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

#include<stdio.h>
int main()
{
	int t,i,year,month,day,y,m,d,w;
	int day1[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31},
						{0,31,29,31,30,31,30,31,31,30,31,30,31}};
				
	char a[7][10]={{"Sunday"},{"Monday"},{"Tuesday"},{"Wednesday"},{"Thursday"},{"Friday"},{"Saturday"}};
	
	
		while(scanf("%d%d%d",&year,&month,&day)!=EOF)
		{
		
		y=year;
		m=month;
		d=day;
		if(m<3)
		{
			m+=12;
			y--;
		}
		w=((d+1+2*m+3*(m+1)/5)+y+y/4-y/100+y/400)%7;
		/*if(year%4==0&&year%100!=0||year%400==0)
		{
			for(i=1;i<month;i++)
				day+=day1[1][i];
		}
		else
		{
			for(i=1;i<month;i++)
				day+=day1[0][i];
		}*/ 
		printf("%s\n",a[w]);
	}
	}