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

函数题:输出指定范围内的自守数

Luz4年前 (2022-10-10)题库528
所谓自守数(也称守形数),是指其平方数的低位部分恰为该数本身的自然数。例如:25*25=625, 因此 25 是自守数。
注:0 和 1 也算自守数。
编写程序输出指定范围内的自守数,没有的话输出None。
### 函数接口定义:
c++
判断x是否为自守数:
int IsAutomorphic(int x);
输出在lower和upper区间内的自守数,没有输出None:
void FindAutomorphic(int lower, int upper);

其中 x 是用户传入参数,它需要被判断的数。
lower和 upper 都是用户传入的参数。 FindAutomorphic程序输出[lower, upper]区间内的自守数。

### 裁判测试程序样例:
c++

#include <stdio.h>

int IsAutomorphic(int x);
void FindAutomorphic(int lower, int upper);

int main()
{
int a, b;
scanf("%d%d", &a, &b);
FindAutomorphic(a, b);
return 0;
}


/* 请在这里填写答案 */


### 输入样例:

in
10 100


### 输出样例:

out
25
76

### 输入样例:

in
400 500


### 输出样例:

out
None








答案:若无答案欢迎评论