解题思路:
注意事项:
参考代码:
#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语言程序设计教程(第三版)课后习题8.9 (C语言代码)浏览:570 |
C语言程序设计教程(第三版)课后习题11.5 (C语言代码)浏览:1534 |
C语言程序设计教程(第三版)课后习题6.7 (C语言代码)浏览:520 |
P1001 (C语言代码)浏览:801 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:507 |
简单的for循环浏览:1410 |
WU-拆分位数 (C++代码)浏览:785 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:543 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:472 |
完数 (C语言代码)浏览:693 |