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

PROGRAMMING:Recursive realization of continuous integer sum function

Luz5年前 (2021-05-10)题库465
Write a function whose formal parameters are two integers a and B (0 < a < = b), and return the sum of all integers between a and B. It is required to implement non recursion and recursion respectively, and try different recursion strategies. The main function inputs two integers m and N, and outputs the sum of continuous integers from m to n.
###Input example:
```in
1 10
```
###Output example:
```out
fifty-five
```
###Input example:
```in
20 30
```
###Output example:
```out
two hundred and seventy-five
```
###Input example:
```in
100 200
```
###Output example:
```out
fifteen thousand one hundred and fifty
```







answer:If there is no answer, please comment