赞
踩
#include<stdio.h>
int main()
{
int any = 0;
for (int i = 100;i <= 999;i++)
{
any = i;
int sum = 0;
int temp = 1;
for (int j = 0;j <= 2;j++)
{
sum += any % 10;//获取三位数字相加
temp *= any % 10;//获取三位数字相乘
any = any / 10;
}
if (sum == temp)//判断是否满足相等
{
printf("%d\n", i);
}
}
return 0;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。