#include <iostream> using namespace std; int main() { int i=0; while(i<=256) { int m = i*i; int x =0; int j = m; while(j>0) { int k = j%10; j = j / 10; x = x*10+k; } if(m==x) { printf("%d\n",i); } i++; } }