import java.io.*; /** * 从 100 循环到 1000,用三个 int 分别保存百位、十位和个位。 */ public class Main { public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); public static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); public static StreamTokenizer cin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); public static PrintWriter cout = new PrintWriter(new OutputStreamWriter(System.out)); public static void main(String[] args) throws Exception { int a, b, c; int temp; for (int i = 100; i < 1000; i++) { temp = i; c = temp % 10; temp /= 10; b = temp % 10; temp /= 10; a = temp % 10; if (Math.pow(a, 3) + Math.pow(b, 3) + Math.pow(c, 3) == i) { cout.println(i); } } cout.flush(); } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:529 |
点我有惊喜!你懂得!浏览:1334 |
汽水瓶 (C语言代码)浏览:610 |
C语言程序设计教程(第三版)课后习题11.3 (C语言代码)浏览:1039 |
C语言程序设计教程(第三版)课后习题5.5 (C语言代码)浏览:669 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:751 |
兰顿蚂蚁 (C++代码)浏览:1049 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:586 |
最小公倍数 (C语言代码)浏览:1029 |
Cylinder (C语言描述,蓝桥杯)浏览:1247 |