#include<iostream>
using namespace std;
#include<cmath>
int main(){
for (int i = 1; i <= 9; i++) {
for (int j = 0; j < +9; j++) {
int n = i * 1000 + i * 100 + j * 10 + j;
int m = floor(sqrt(n) + 0.5);
if (n == m*m) {
cout << n << endl;
}
}
}
return 0;
}
#includeusing namespace std;#includeint main(){ for (int i = 1; i <= 9; i++) { for (int j = 0; j < +9; j++) { int n = i * 1000 + i * 100 + j * 10 + j; int m = sqrt(n);//该句更为保险的写法为: int m = floor(sqrt(n) + 0.5); if (n == m*m) { cout << n << endl; } } }}