본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 13773번 Olympic Games

by 현장 2024. 10. 9.

-Code

while True:
    year = int(input())

    if year == 0:
        break

    if 1896 <= year and year % 4 == 0:
        if 1914 <= year <= 1918 or 1939 <= year <= 1945:
            print(year, "Games cancelled")
        elif 2020 < year:
            print(year, "No city yet chosen")
        else:
            print(year, "Summer Olympics")
    else:
        print(year, "No summer games")