G
Guest
Guest
Help me please on this c++ problem
Some numbers like 153, 370, 371, 407, … have the property that the number equals the cube sum of its digits. For example:
153: 13 + 53 + 33 = 1 + 125 + 27 = 153
(the left side of the equation is confusing. He means "1cubed+5cubed+3cubed" but that's not possible to write here correctly)
370: 33 + 73 + 03 = 27 + 343 + 0 = 370
371: 33 + 73 + 13 = 27 + 343 + 1 = 371
407: 43 + 03 + 73 = 64 + 0 + 343 = 407
Write a program that prompts the user to enter two positive integers lower and upper, then finds and prints all numbers in the interval [lower, upper] that have the property that the cube sum of the digits equals the number itself. The program also prints the how many numbers have the cube sum property.
Some numbers like 153, 370, 371, 407, … have the property that the number equals the cube sum of its digits. For example:
153: 13 + 53 + 33 = 1 + 125 + 27 = 153
(the left side of the equation is confusing. He means "1cubed+5cubed+3cubed" but that's not possible to write here correctly)
370: 33 + 73 + 03 = 27 + 343 + 0 = 370
371: 33 + 73 + 13 = 27 + 343 + 1 = 371
407: 43 + 03 + 73 = 64 + 0 + 343 = 407
Write a program that prompts the user to enter two positive integers lower and upper, then finds and prints all numbers in the interval [lower, upper] that have the property that the cube sum of the digits equals the number itself. The program also prints the how many numbers have the cube sum property.