//这样应该能行
package com.study;
public class TestFlower {
public static void main(String[] args) {
int temp = 0,i1,i2,i3;
for(int i=100;i<=999;i++) {
i1=i%10;
i2=(i%100)/10;
i3=i/100;
temp=(int) (Math.pow(i1,3)+Math.pow(i2,3)+Math.pow(i3,3));
if(i==temp){
System.out.println(temp);
}
}
}
}
|