解题思路:
注意事项:
参考代码:
public class The156 {
public static void main(String args[]){
for(int i=2;i<1000;i++){
String a=""+i;
int b[]=new int[a.length()];
double sum=0;
//把字符串赋值给数组
for(int C=0;C<a.length();C++){
b[C]=a.charAt(C);
}
//求各位三次方的和
for(int d=0;d<b.length;d++){
sum=sum+Math.pow(b[d], 3);
}
if(sum==i){
System.out.print(i+" ");
}
}
}
}
0.0分
0 人评分