package zuoye;
public class print {
void output()
{
System.out.println("100-999之间的水仙花数是:");
for(int sum=100;sum<=999;sum++)
{
if(Math.pow(sum/100, 3)+Math.pow(sum%10, 3)+Math.pow(sum/10%10, 3)==sum)
{
System.out.println(sum);
}
}
}
}
package zuoye;
import java.util.Scanner;
public class E {
public static void main(String[] args) {
print pt=new print();
pt.output();
}
}