publicclassHH{
/**
*@paramargs
*1000以内的水仙花数
*/
publicvoidshuiXian(){
intn=1000;
inty1,y2,y3;
for(inti=1;i<n;i++){
y1=i/100;
y2=i%100/10;
y3=i%10;
if((y1*y1*y1+y2*y2*y2+y3*y3*y3)==i){
System.out.println(i+"");
}
}
}
publicstati段关层春极生可又往耐则cvoidmain(String[]args){
HHa=newHH();
a.shuiXian();
}
}