#include <iostream> #include <string> #include <algorithm> using namespace std; bool judge(int in) { string s = to_string(in); string temp = s; reverse(s.begin(), s.end()); return temp == s; } int main() { for(int i = 0;i < 256;i++){ if(judge(i*i)) cout << i << endl; } } // 64 位输出请用 printf("%lld")