-
Notifications
You must be signed in to change notification settings - Fork 0
/
0027.cc
73 lines (67 loc) · 1.15 KB
/
0027.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <iostream>
#include <set>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <sstream>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cassert>
#include <string>
using namespace std;
int month2day(int month){
int ans = 0;
switch(month){
case 11:
ans += 30;
case 10:
ans += 31;
case 9:
ans += 30;
case 8:
ans += 31;
case 7:
ans += 31;
case 6:
ans += 30;
case 5:
ans += 31;
case 4:
ans += 30;
case 3:
ans += 31;
case 2:
ans += 29;
case 1:
ans += 31;
break;
default:
ans += 0;
}
return ans;
}
int main(int argc, char *argv[])
{
int month,day;
string date[7] = {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
while((std::cin >> month >> day) != NULL ){
if(month == 0)break;
--month;--day;
int answer = month2day(month);
answer += day + 3;
answer = answer % 7;
std::cout << date[answer] << std::endl;
}
return 0;
}