Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- y, m, d = map(int, input().translate(str.maketrans(dict.fromkeys('年月日', ' '))).split())
- print(f'{y}年{m}月{d}日', end=' ==> ')
- days = [
- 31, (28, 29)[(y % 4 == 0 and y % 100 != 0) or y % 400 == 0],
- 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
- ]
- if d + 7 > days[m - 1]:
- d += 7 - days[m - 1]
- if m == 12:
- y += 1
- m = 1
- else:
- m += 1
- else:
- d += 7
- print(f'{y}年{m}月{d}日')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement