알고리즘 예제/Python

[Python] - Coding Test / 6079 문제

KimTory 2022. 3. 6. 19:36

✍ CodeUp 문제  / 출처 : Codeup

👉 Input

55

 

👉 Output

10

 

👉 Source Code

n = int(input())

sum = 0;

for i in range(1, 1001):
    sum += i
    if sum >= n:
        break

print(i)