-->
当前位置:首页 > 题库

PROGRAMMING:The largest number (Cixi, 2009)

Luz5年前 (2021-05-10)题库408
Today, Yangcun is going to hold a "knowledge competition". Many sheep have participated in the competition. The village head decides to hold a preliminary election first, select some people, and then participate in the competition. He gives a positive integer m, and finds the maximum n value of s < = m among the values of S = 1 + 2 + 3 +... + n. If the value of M is 7, then n is 3, because 1 + 2 + 3 = 6, 1 + 2 + 3 + 4 = 10, so under the condition of s < = m, the maximum value of n is 3. For a given value of M, pleasant goat quickly says the value of n that meets the condition. Now please write a program to solve this problem.
###Input format:
The input has only one number, which is the value of M( M<=1000000000)
###Output format:
The output has only one number, which is the maximum value of n that meets the condition of the title.
###Input example:
```in
seven
```
###Output example:
```out
three
```







answer:If there is no answer, please comment