解题思路:
注意事项:
参考代码:
#include <cstdio> #include <cstdlib> #include <iostream> #include <cmath> #include <cstring> #include <string> #include <algorithm> #include <functional> int f(int n) { int cnt = 0, m = n; while(m) { cnt++; m /= 10; } if(n ==(long long)pow(n,2)%(long long)pow(10,cnt)) { return 1; } return 0; } int main() { printf("%d", 0); for(int i = 1; i <= 200000; ++i) { if(f(i)) { printf(" %d", i); } } printf("\n"); return 0; }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题7.4 (C语言代码)浏览:560 |
C语言训练-求矩阵的两对角线上的元素之和 (C语言代码)浏览:3394 |
C语言程序设计教程(第三版)课后习题8.5 (C语言代码)浏览:576 |
C语言程序设计教程(第三版)课后习题9.3 (C语言代码)浏览:2092 |
最小公倍数 (C语言代码)浏览:1029 |
母牛的故事 (C语言代码)浏览:551 |
1035 题解浏览:785 |
C语言训练-亲密数 (C语言描述,反正怎么都能对)浏览:2169 |
The 3n + 1 problem (C语言代码)浏览:505 |
妹子杀手的故事 (C语言代码)浏览:1054 |