先看看运行结果吧!:
源代码:
package Dome;
import java.util.Scanner;
public class FristWork {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner st = new Scanner(System.in);
System.out.print("The Begining:");
String stNom = st.nextLine();
float s = Float.parseFloat(stNom);
if(s<100 || s>999) {
System.out.println("Error!");
}
else {
System.out.print("The Enging:");
for(double i=s;i<1000;i++) {
double bo;
bo = (Math.pow(((int)i%10),3)+Math.pow(((int)i/100),3)
+Math.pow((((int)i/10)%10),3));
if(i == bo) {
System.out.print((int)bo+" ");
}
}
}
st.close();
}
}
end:追寻自己的本心