#include<stdio.h>
int main() {
for (int i = 0; i < 256; i++) {
int tmp = i * i;
int ans = 0;
while (tmp != 0) {
ans = tmp % 10 + ans * 10;
tmp /= 10;
}
if (i * i == ans)
printf("%d\n", i);
}
return 0;
}
题目链接:
http://ac.jobdu.com/problem.php?pid=1074