//这看错题了,用来求所有6位数以下的
#include<math.h>
#include<stdio.h>
int main()
{
int i;
for (i = 10000; i < 100000; i++)
{
int n = i, count = 0, ret = 0, result = 0;
while (n)//求是几位数方便计算
{
n /= 10;
count++;
}
while (count > 1)
{
int t = pow(10, count-1);//分离第一位
int t1 = i / t;//第一位数
int t2 = i % t;//剩下的
ret = t1 * t2;
result = ret + result;
count--;//下次进来同样计算的就是前面两位 + 剩下的
}
if (result == i)
printf("%d ", i);
}
return 0;
}

京公网安备 11010502036488号