This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

30
TangDou/ShuLun/SL1.cpp Normal file
View File

@@ -0,0 +1,30 @@
#include <bits/stdc++.h>
using namespace std;
//是不是同构数
bool isTongGou(int n) {
int a = n * n;
bool res = true;
while (n) {
int b = n % 10;
n /= 10;
int c = a % 10;
a /= 10;
if (b != c) {
res = false;
break;
}
}
return res;
}
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++)
if (isTongGou(i)) cout << i << " ";
return 0;
}