Bluebook
Digits and Sums
Write a program that will find all the three-digit natural numbers that are equal to the sum of the cubes of their digits. The range of number will be 100 ≤ M ≤ N ≤ 999. The input will be two numbers: M and N where M is the lesser 3 digit number and N is the greater 3 digit number.
Sample Input
100 200
Sample Output
153
Explanation of output: For example, the number 153 = 1*1*1 + 5*5*5 + 3*3*3, therefore it should be outputted.
All Submissions
Best Solutions
Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 26, 2008
Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Comments (Search)
Test case #2: Wrong Answer [0.080s, 2.6M] (0/10)
hint plz!
That's not what your program's doing -- reread the question and then look at your if statement.
Your Output:
------------------------------------
------------------------------------
for two of the cases....
can someone help?
The problem is that you're reading the input wrong - notice that the two numbers are on the same line.
if there are no numbers; what are we supppose to output?