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: 2018212212086
In contest: 1273

#include<stdio.h>
#include<math.h>

int weeknumber(int a,int b,int c){
	int w;
	if (1==b ||2==b){
		b+=12;
		a--;}
	w=(c+1+2*b+3*(b+1)/5+a+a/4-a/100+a/400)%7;
	return w;
}

const char *week(int a){
	switch(a)
    {   
        case 0 : return "Sunday"; break;
        case 1 : return "Monday"; break;
        case 2 : return "Tuesday"; break;
        case 3 : return "Wednesday"; break;
        case 4 : return "Thursday"; break;
        case 5 : return "Friday"; break;                                                             
        case 6 : return "Saturday"; break;
        default : return NULL; break;
    }   
}
int main(){
	int y,m,d;
	while(scanf("%d %d %d",&y,&m,&d)!=EOF){
	const char * p=week(weeknumber(y,m,d));
	printf("%s\n",p);
	}
	return 0;
}