public class Pow3 { public static void main(String[] args) { for(int i=100;i<1000;i=i+1) { if(isNo(i)){ System.out.println(i+"shu"); } } } public static boolean isNo(int w) { int a = w%10; int b = w/10%10; int c = w/100; if(Math.pow(a,3)+Math.pow(b,3)+Math.pow(c,3)==w) return true; else return false; } //public static int TT(int a){//不用Math时用 //return a*a*a; //} }