原文:编写一个Java应用程序,该应用程序包括2个类:Print类和主类E。Print 类里有一个方法output()功能是输出100 ~ 999之间的所有水仙花数(各位数字的 立方和等于这个三位数本身,如: 371 = 33 + 73 + 13。)在主类E的main方法中来 测试类Print。

package liu public class Print void output for int i i lt i if Math.pow i , Math.pow i , Math.pow i , i System.out.println i package liu public class E public static void main String args Print pr ne ...

2016-09-17 15:39 0 1937 推荐指数:

查看详情

编写一个Java应用程序,该应用程序包括2个PrintEPrint 一个方法output()功能输出100 ~ 999之间所有水仙花(各位数字立方等于这个三位数本身,如: 371 = 33 + 73 + 13。)在Emain方法测试Print

package zuoye; public class print { void output() { System.out.println("100-999之间水仙花是:"); for(int sum=100;sum<=999;sum++) { if(Math.pow(sum ...

Sat Sep 17 23:21:00 CST 2016 0 1798
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM