解题思路:
注意事项:
如果从2开始,时间超限;所以讨了个巧,算出最小值4150,最大值194979
参考代码:
public class Main {
public static void main(String[] args) {
long i=4150;//0,1不算
while(i!=194980) {
String str="";
str+=i;
long sum=0;
for(int j=0;j<str.length();j++) {
String str1=""+str.charAt(j);
int m=Integer.parseInt(str1);
sum+=Math.pow(m, 5);
}
if(sum==i)
System.out.println(i);
i++;
}
}
}
0.0分
1 人评分
点我有惊喜!你懂得!浏览:1220 |
C二级辅导-进制转换 (C语言代码)浏览:615 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:509 |
【蟠桃记】 (C语言代码)浏览:648 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:1297 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:534 |
图形输出 (C语言代码)浏览:1380 |
演讲大赛评分 (C语言代码)浏览:1629 |
C语言程序设计教程(第三版)课后习题10.3 (C语言代码)浏览:509 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:324 |