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: 26ms
Memory: 1712kB
Author: 2018212212012
In contest: 1273

#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>

using namespace std;

int main()
{	
    int y, m, d;
    while(cin >> y >> m >> d){
    	
    	if(m<3){
    		y = y - 1;
    		m = 12+m;
		}
		int c = y/100;
    	y = y%100;
    	
		int w;
		w = y + int(y/4) + int(c/4) - 2*c + int((26*(m+1))/10) + d - 1;
    	if(w>=0){
    		w = w%7;
		}else{
			w = (w%7+7)%7;
		}
		
		switch(w){
			case 0:cout << "Sunday" << endl;break;
			case 1:cout << "Monday" << endl;break;
			case 2:cout << "Tuesday" << endl;break;
			case 3:cout << "Wednesday" << endl;break;
			case 4:cout << "Thursday" << endl;break;
			case 5:cout << "Friday" << endl;break;
			default:cout << "Saturday" << endl;
		}
			
	}
	
		
	return 0;
}