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

#include<stdio.h>

void WD(int y,int m,int d) {
	if(m==1||m==2) {
		m=m+12;
		y--;
	}
	int iWeek=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7;
	switch(iWeek) {
		case 0: {
			printf("Monday\n");
			break;
		}
		case 1: {
			printf("Tuesday\n");
			break;
		}
		case 2: {
			printf("Wednesday\n");
			break;
		}
		case 3: {
			printf("Thursday\n");
			break;
		}
		case 4: {
			printf("Friday\n");
			break;
		}
		case 5: {
			printf("Saturday\n");
			break;
		}
		case 6: {
			printf("Sunday\n");
			break;
		}
	}
}

int main() {
	int y,m,d;
	while(scanf("%d%d%d",&y,&m,&d) != EOF) {
		WD(y,m,d);
	}
	return 0;
}