解题思路:
注意事项:
参考代码:
#include <stdio.h>
#include <math.h>
int zishoushu(int i)
{
long int g=i,count=0,k,c=0;
while(i!=0)
{
count++;
i=i/10;
}
k=(g*g)%(int)pow(10,count);
if(k==g)
{
c=1;
}
return c;
}
int main()
{
int i;
for(i=0;i<200000;i++)
{
if(zishoushu(i))
printf("%d ",i);
}
return 0;
}
0.0分
0 人评分
C二级辅导-统计字符 (C语言代码)浏览:533 |
母牛的故事 (C语言代码)浏览:668 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:564 |
A+B for Input-Output Practice (VI) (C++代码)浏览:417 |
拆分位数 (C语言代码)浏览:1327 |
大神老白 (C语言代码)浏览:642 |
WU-蓝桥杯算法提高VIP-交换Easy (C++代码)浏览:1114 |
C语言程序设计教程(第三版)课后习题11.8 (C语言代码)浏览:876 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:619 |
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:508 |