class Daffodil{
public static void main(String args[]){
int s = 0;
int t,c;
for(int i=100; i<=999; i++){
c = i;
for(int j=0; j<3; j++){
t = c % 10;
c = c / 10;
s += t*t*t;
}
if(s == i){
System.out.println(i);
}
s = 0;
}
}
}
输出结果: