n = int(input())
sum = 0
i = 0
while (sum<n):
sum += i
i += 1
print(i-1)
50
10
# (0+1+2+3+4+5+6+7+8+9=45| 45<50)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Python
n = int(input())
sum = 0
i = 0
while (sum<n):
sum += i
i += 1
print(i-1)
Вывод:
50
10
# (0+1+2+3+4+5+6+7+8+9=45| 45<50)