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

PROGRAMMING:Looking for the perfect number*

Luz5年前 (2021-05-10)题库534
A number whose sum of all true factors is less than itself is called a deficiency. For example, if the sum of true factors 1 and 2 of 4 is 3, less than 4, it is a deficiency.
The number whose sum of all true factors is greater than itself is called surplus number. For example, if the sum of true factors 1, 2, 3, 4 and 6 of 12 is 16, greater than 12, it is surplus.
A perfect number is a number in which the sum of all true factors is equal to itself. For example, the sum of true factors 1, 2 and 3 of 6 is exactly 6, which is a perfect number.
Please write a program to display the perfect number within the specified range.
####Input format
>Two positive integers a and B, and a ≤ B, that is, the lower limit and upper limit of the interval [a, b].
####Output format
>If there are perfect numbers in the interval, output all perfect numbers in one line, separated by spaces. If there is no perfect number in the interval, output "None".
####Input sample 1
```in
1 30
```
####Output sample 1
```out
6 28
```
####Input sample 2
```in
100 400
```
####Output sample 2
```out
None
```







answer:If there is no answer, please comment