본문 바로가기
python-algorithm

[백준] 5724

by 무적김두칠 2021. 1. 9.

1
2
3
4
5
6
7
8
9
10
import sys
def pinman(n):
    cnt=0
    for i in range(1,n+1):
        cnt+=pow(i,2)
    return(cnt)
while True:
    n=int(sys.stdin.readline())
    if n==0: exit()
    elseprint(pinman(n))
cs
반응형

'python-algorithm' 카테고리의 다른 글

[백준] 5988  (0) 2021.01.10
[백준] 5789  (0) 2021.01.10
[백준] 5704  (0) 2021.01.09
[백준] 5691  (0) 2021.01.09
[백준] 5656  (0) 2021.01.09

댓글