题解 | #对称平方数1#
对称平方数1
https://www.nowcoder.com/practice/a84d46d5321f4e20931cb725e6c74fad
#include <iostream> using namespace std; int reverse (int n){ int a = 0, b = 0; while (n != 0){ a = n % 10; n /= 10; b = b * 10 + a; } return b; } int main () { for (int i = 0; i <= 256; i++){ if (reverse(i * i) == i * i){ cout << i << endl; } } return 0; }