#C6127. Sum of Cubes Challenge
Sum of Cubes Challenge
Sum of Cubes Challenge
You are given a non-negative integer \( n \). Your task is to determine whether \( n \) can be expressed as the sum of the cubes of its digits. In other words, check if:
\( n = \sum_{i=1}^{k} d_i^3 \)
where \( d_i \) represents each digit of \( n \). For example, if \( n = 153 \), since \( 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153 \), the output should be True
. Otherwise, output False
.
This problem tests your ability to work with individual digits of a number and perform elementary operations. Pay attention to the input/output format as specified.
inputFormat
The input consists of a single line containing a non-negative integer \( n \).
outputFormat
Output a single line: True
if \( n \) can be written as the sum of the cubes of its digits, otherwise output False
.
153
True