//思路一的实现
public static void shuixianhua_1(){
for (int i=100;i<1000;i++){
int g=i%10; //个位
int s=(i/10)%10; //十位
int b=i/100; //百位
if (i==g*g*g+s*s*s+b*b*b){
System.out.print(i+" ");
}
}
}
//思路二的实现
public static void shuixianhua_2(){
for (int i=1;i<=9 ;i++ ){ //百位
for (int j=0;j<=9 ;j++ ){ //十位
for (int k=0; k<=9;k++ ){ //个位
int tmp1=100*i+10*j+k;
int tmp2=i*i*i+j*j*j+k*k*k;
if (tmp1 == tmp2){
System.out.print(tmp1+" ");
}
}
}
}
}
}
for (int i = 100; i < 1000;i++ ) {
int temp = i;
int ge,shi,bai;
ge = i % 10;//取出个位,假设i取到123 ge=123%10=3
i = i / 10;//截掉最低位 i=12
shi = i % 10;// shi = 2
bai = i / 10;// bai =1
int a = ge * ge * ge + shi * shi * shi + bai * bai * bai;
if (temp==a) {
System.out.print(temp);
}