#include <iostream>
using namespace std;
class Self
{
private:
int a[20];
int m, n, p;
public:
Self(int _m, int _n)
{
m = _m; n = _n;
}
void process()
{
int pf;
int j = 0;
p = 0;
for (int i = m; i <= n; i++)
{
int k = i;
pf = k * k;
while (k != 0)
{
if ((pf % 10) != (k % 10))break;
k = k / 10;
pf = pf / 10;
}
if (k == 0)
{
a[j] = i;
p++;
j++;
}
}
}
void print()
{
cout << "自守数的个数为:" << p << endl;
for (int j = 0; j < p; j++)
cout << a[j] << '\t';
cout << endl;
}
};
void main()
{
Self test(1, 110);
test.process();
test.print();
}