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

PROGRAMMING:Sum of integer segments

Luz5年前 (2021-05-10)题库429
Given two integers $$a $$and $$B $$, output all integers from $$a $$to $$B $$and the sum of these numbers.
###Input format:
Input gives two integers $$a $$and $$B $$in one line, where $$- 100 / Le A / Le B / Le 100 $$, separated by spaces.
###Output format:
First, all integers from $$a $$to $$B $$are output in order, with 5 digits in a row and 5 characters in width, aligned to the right. Finally, output the sum of all numbers' x 'in the format of' sum = x 'in one line.
###Input example:
```in
-3 8
```
###Output example:
```out
-3 -2 -1 0 1
2 3 4 5 6
7 8
Sum = 30
```






answer:If there is no answer, please comment