https://www.acmicpc.net/problem/5341
1
2
3
4
5
6
7
8
9
|
def sol(n):
return int(n*(n+1)/2)
if __name__ == '__main__':
while 1:
n = int(input())
if n == 0:
break
print(sol(n))
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
백준 10189 Hook (0) | 2022.12.19 |
---|---|
백준 6840 Who is in the middle? (0) | 2022.12.17 |
백준 26489 Gum Gum for Jay Jay (0) | 2022.12.17 |
백준 26057 Большой удой (1) | 2022.12.13 |
백준 11008 복붙의 달인 (0) | 2022.12.13 |
댓글