티스토리 뷰
파이썬에는 스위치가 없어서 직접 구현해서 사용했다.
N = input().split()
x = int(N[0])
y = int(N[1])
d = 0
def switch(day):
return {
1 : 'MON',
2 : 'TUE',
3 : 'WED',
4 : 'THU',
5 : 'FRI',
6 : 'SAT',
0 : 'SUN'
}.get(day)
def switch2(month):
return {
1 : 31,
2 : 28,
3 : 31,
4 : 30,
5 : 31,
6 : 30,
7 : 31,
8 : 31,
9 : 30,
10 : 31,
11 : 30,
12 : 31
}.get(month)
for Repeat in range(1, x):
if x != 1:
d += switch2(Repeat )
d += y
print(switch(d%7))
'문제 풀이 > Baekjoon Online Judge' 카테고리의 다른 글
| [python3] 11720번 숫자의 합 (0) | 2018.03.28 |
|---|---|
| [python3] 8393번 합 (0) | 2018.03.28 |
| [python3] 2441번 별찍기 - 4 (0) | 2018.03.28 |
| [python3] 2440번 별찍기 - 3 (0) | 2018.03.27 |
| [python3] 2556번 별찍기 - 14 (0) | 2018.03.26 |
댓글