3. Sum Cubes
by CodeChum Admin
The square of an integer refers to the result of multiplying the integer with itself once. While the cube of an integer refers to the result of multiplying the integer with itself twice. As long as you know that, you could easily solve this!
Instructions:
Input three integers and compute the cubes of each of them.
Check if the sum of the cubes are positive. If it is, print out "Positive", and if not, print out "Negative".
Instructions
Input three integers (negative, positive, or zero) and compute the cubes of each of them.
Check if the sum of the cubes are positive. If so, print out "Positive", and if not, print out "Negative".
Input
A line containing three integers separated by a space.
1 2 3
Output
A line containing a string.
Positive
N1=int(input("Enter the first interger: "))
N2=int(input("Enter the second interger: "))
N3=int(input("Enter the third interger: "))
cube1=N1*N1*N1
cube2=N2*N2*N2
cube3=N3*N3*N3
add=cube1+cube2+cube3
if add>0:
print("Positive")
else:
print("Negative")
Comments
Leave a comment