找出100-999之间的水仙花数

 double sum ;
        for(int i = 100,j;i<=999;i++){
            j = i;
            sum = 0;
            //内存循环完成各数位的立方和 循环体:余10.降位
            while(j>=1){
                sum += Math.pow(j%10,3);
                j/=10;
            }
            if(sum == i){
                System.out.println(i);
            }
        }

原文地址:https://www.cnblogs.com/chenyyStudy/p/12913652.html