class shuixianhua
{
public static void main(String[] args)
{
System.out.println("水仙花数:");
for (int a=1 ; a<10 ; a++)
{
for (int b=0 ; b<10 ; b++)
{
for (int c=0 ; c<10 ; c++)
{
if ((100*a+10*b+c)==(a*a*a+b*b*b+c*c*c))
{
System.out.print((100*a+10*b+c)+" ");
}
}
}
}
}
} |
|