“水仙花数”是指一个三位数,其各位数字的立方和确好等于该数本身,如;153=1+5+3?,则153是一个“水仙花数”。
机翻英语 :
Java prints daffodils in the range of 100-1000
A "daffodil number" is a three-digit number whose cube sum is exactly equal to the number itself, e.g. 153 = 1 + 5 + 3? , 153 is a "daffodil number".
/ * *
public class One {
public static void main(String[] args) {
int a,b,c;
for(int i= 101; i < 1000; i++){
a = i/100;
b = i%100/10;
c = i%10;
if((a*a*a + b*b*b + c*c*c) == i) {
System.out.println(i+"是一个水仙花数"); }
}
}
}



