随笔分类 -  水仙花数-常用编程小程序

总结几个小程序,通过javascript打印出100---999之间的水仙花数 153=1^3+5^3+ 3^3
摘要:153/100 (153-1*100)/10 153-1*100-5*10 */ document.write("100---999之间的水仙花数为:"); document.write("<br>"); for(i = 100; i < 1000;i++){ var num1 = Math.floor(i/100); var num2 = Math.floor((i - num1*100)/10); var num3 = Math.floor(i-(... 阅读全文
posted @ 2012-07-28 10:46 妍珊 阅读(1987) 评论(0) 推荐(0)