c语言中运用for语句找出1-1000的同构数,尽量用简单的代码,刚开始学,通俗易懂😄
#include<stdio.h>
#include<math.h>
int main()
{
int a=0,b=0,c=0,sqare;
int i=0,j=0;
printf("Print all the isomorphism between 1-999:\n");
for(i=1;i<=1000;i++)
{
a=i*i;
int pow=1;
while(pow<=i)
pow*=10;//判断有几位是0
if((a-i)%pow==0)
printf("%d ",i);
}
return 0;
}