#include<iostream> using namespace std; int Reverse(int n){ int answer=0; while(n){ answer*=10; answer+=n%10; n/=10; } return answer; } int main(){ for(int n=1;n<256;n++){ if(n*n==Reverse(n*n)){ cout<<n<<endl; } } }
#include<iostream> using namespace std; int Reverse(int n){ int answer=0; while(n){ answer*=10; answer+=n%10; n/=10; } return answer; } int main(){ for(int n=1;n<256;n++){ if(n*n==Reverse(n*n)){ cout<<n<<endl; } } }