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

PROGRAMMING:Calculate 11 + 12 + 13 +... + M

Luz5年前 (2021-05-10)题库466
Enter a positive integer m (20 < = m < = 100) to calculate the value of 11 + 12 + 13 +... + M.
###Input format:
Enter a positive integer m on one line.
###Output format:
In one line, output the corresponding sum and s according to the format "sum = s"
###Input example:
Here is a set of inputs. For example:
```in
ninety
```
###Output example:
The corresponding output is given here. For example:
```out
sum = 4040
```







answer:If there is no answer, please comment
```
m=eval(input())
s=sum([i for i in range(11,m+1)])
print("sum =",s)
```