水仙花数 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 96473 Accepted Submission(s): 28632 Problem Description 春天是鲜花的季节,水仙花就是其中最迷人的代表,数学上有个水仙花数,他是这样定义的: "水仙花数"是指一个三位数,它的各位数字的立方和等于其本身,比如:1…
水仙花数 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 268130 Accepted Submission(s): 75246 Problem Description 春天是鲜花的季节,水仙花就是其中最迷人的代表,数学上有个水仙花数,他是这样定义的:“水仙花数”是指一个三位数,它的各位数字的立方和等于其本身,比如:153=1^3…
package printDaffodilNumber; /* * 题目:打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数本身.(100~1000) * 比如:153是一个"水仙花数",因为153=1的三次方+5的三次方+3的三次方. */ public class printNumber { static int number1; static int number2; static int number3;…
最近在尝试做acm试题,刚刚是1001题就把我困住了,这是题目: Problem Description In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. Input The input will consist of a series of integers n, one integer per line Output For each case, output SUM(n) in one…
所谓水仙花数是满足类似于153=1³+5³+3³: 第一种方式:把这个数当做字符串来实现 <script> for(var i=100;i<=999;i++) { str_i=i.toString(); var hundred=Number(str_i.charAt(0));//运用charAt(index)函数找百位数 var ten=Number(str_i.charAt(1)); var dig=Number(str_i.charAt(2)); var result=Math.po…