The amount of cubes with recursion - finding the best amount of cubes
📁 python, ии
sumofcubes ( n ): if n == 0 : retu sumofcubes (n - ( int (n ** ( 1 / 3 ))) ** 3 ) print (( int (n ** ( 1 / 3 )) ** 3 ), end = '' ') sumofcubes ( int span> ( input ())) Important! The task should be solved by a recurrent function.
The task is to represent a natural number in the form of the sum of cubes of other natural numbers, and the smallest possible number of terms should be.
INTRODUCTION: 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 2EAL 216
Introduction: 100
Conclusion: 1 8 27 64
The site that this code is sent reports on incorrect answers.
the program should deduce the number transferred to it in the form of the sum of cubes of other natural numbers. This amount should consist of the smallest amount of terms among all such amounts.
Ответов пока нет.
Войдите чтобы оставить ответ