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

[백준/파이썬] 4655번 Hangover

by 현장 2024. 6. 25.

-Code

while True:
    n = float(input())

    if n == 0:
        break

    l, res = 2, 0

    while res < n:
        res += 1 / l
        l += 1

    print(f"{l - 2} card(s)")