package com.llh.demo;
/**
* 水仙花数
* @author llh
*
*/
public class Demo14 {
public static void main(String[] args) {
for (int i = 100; i <= 999; i++) {
//取出每一位上的数
int gum, sum, bum,num;
bum = i/100;
sum =(i-bum*100)/10;
gum =i-bum*100-sum*10;
num=(int) (Math.pow(gum,3) + Math.pow(sum,3) + Math.pow(bum,3));
if (i == num) {
System.out.println(i);
}
}
}
}