#include <stdio.h>
/*
*水仙花数
*时间:2013-9-9
*版本:1.0
*/
int main(void)
{
int num, l, m, n;
for(num = 100;num <= 999;num++)
{
l = num / 100;
m = (num % 100) / 10;
n = num % 10;
if(l * 100 + m * 10 + n == (l * l * l) + (m * m * m) + (n * n * n))
printf("下面为水仙花数:%d\n",num);
}
system("pause");
return 0;
}
/*
*水仙花数
*时间:2013-9-9
*版本:1.0
*/
int main(void)
{
int num, l, m, n;
for(num = 100;num <= 999;num++)
{
l = num / 100;
m = (num % 100) / 10;
n = num % 10;
if(l * 100 + m * 10 + n == (l * l * l) + (m * m * m) + (n * n * n))
printf("下面为水仙花数:%d\n",num);
}
system("pause");
return 0;
}