class Hua
{
public static void main(String[] args)
{
for(int i = 100; i <= 999; i++)
{
int ge = i%10;
int shi = i/10%10;
int bai = i/10/10%10;
if(ge*ge*ge+shi*shi*shi+bai*bai*bai==i)
{
System.out.println("水仙花数"+i);
}
}
}
}
作者: 罗韬 时间: 2015-4-23 21:34
int ge = i%10; int shi = i/10%10; int bai = i/100%10; int qian = i/1000%10; int wan = i/10000%10;作者: OCTSJimmy 时间: 2015-4-23 21:47