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: 1092kB
Author: 2018212212067
In contest: 1273

#include<stdio.h>
int getweek(int year,int month,int day){
	int aweek[12]={0,3,2,5,0,3,5,1,4,6,2,4};
	int week=0;
	int temp=0;
	year-=month<3;
	temp=(year+year/4-year/100+year/400+aweek[month-1]+day)%7;
	switch(temp)
	{
	case 0:week=7;break;
	case 1:week=1;break;
	case 2:week=2;break;
	case 3:week=3;break;
	case 4:week=4;break;
	case 5:week=5;break;
	case 6:week=6;break;
	default:week=0;break;
	}
	return week;
}
int main(){
	int y,m,d,week;
	while (scanf("%d%d%d",&y,&m,&d)!=EOF)
	{
	week=getweek(y,m,d);
	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 7:printf("Sunday\n");break;
	}
	}
	return 0;
}