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

PROGRAMMING:Happy number

Luz5年前 (2021-05-10)题库444
We know that an integer can be expressed as the sum of the squares of two different integers, such as 25 = 3 * 3 + 4 * 4. Lele calls such integers happy numbers. Your job is to help Lele find out how many happy numbers there are between M and n.
###Input format:
Only one line has two integers m and N in the range of long integers, separated by a space.
###Output format:
There is only one line and only one integer: the number of happy numbers in the range of m to n.
###Input example:
```in
1 20
```
###Output example:
```out
five
```
[input and output example description]
There are five happiness numbers between 1 and 20. They are 5, 10, 13, 17 and 20
[data range]
For 50% of the data, 1 < = m < n < = 10 ^ 4
For 100% data, 1 < = m < n < = 10 ^ 7







answer:If there is no answer, please comment