}
else
continue;
}
return 0;
}
int main()
{
isPFHS();
return 0;
}
#include <math.h>
int isPFHS()
{
int n, n1, x;
printf("1000以内的平方回数为:\n");
for (n = 121; n < 1000; n++)
{
// n1 = n % 10 + n1 * 10; n1没有初始化
n1 = 0;
x = n;
while (x)
{
n1 = n1 * 10 + x % 10;
x /= 10;
}
// n = n / 10; 循环变量不能随便动
if (n == n1)
{
x = sqrt(n);
// for (x = 1; x < n; x++)
// {
if (n == x * x)
printf("%-5d", n);
//}
}
// else
// continue;
}
return 0;
}