Beakjoon&프로그래머스/파이썬

[백준/파이썬] 5341번 Pyramids

현장 2022. 12. 17. 19:11

-Code

while 1:
    n = int(input())
    if n == 0:
        break
    print(n * (n + 1) // 2)