/
思想:取数据各个位上的值
需求:在控制台输出所有的"水仙花数"
分析:
所谓的水仙花数是指一个三位数,其各位数字的立方和等于该数本身
比如:
153=1
11 + 555 + 333
/
class ForDemo4{
public static void main (String[] args){
for (int x = 100;x<=999;x++){
int ge = x%10; //想要取一个数的个位数值,就用该数对10取余
int shi=x/10%10; //想要取一个数的十位数值,就用该数先除以10,把原十位数值移至个位,然后对10取余
int bai=x/100%10; //和上同理
if ( x == (gegege+shishishi+baibaibai)){
System.out.println(x);

        }

    }

} 

}