解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class C1851 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()) { int m = sc.nextInt(); int n = sc.nextInt(); F(m,n); } } public static void F(int m ,int n) { int count = 0; for (int i = m; i <= n; i++) { int a = i/100; int b = i%100/10; int c = i%10; int num = (int) ((Math.pow(a, 3))+(Math.pow(b, 3))+(Math.pow(c, 3))); if(num == i) { count++; System.out.print(i+" "); } } if(count==0) { System.out.println("no"); } } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:851 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:1296 |
C语言程序设计教程(第三版)课后习题6.11 (C语言代码)浏览:549 |
2005年春浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:582 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:636 |
C语言程序设计教程(第三版)课后习题9.10 (C语言代码)浏览:820 |
C二级辅导-等差数列 (C语言代码)浏览:695 |
输出九九乘法表 (C语言代码)浏览:1048 |
简单的a+b (C语言代码)浏览:506 |
1134题解(求分析)浏览:723 |