Sum of Cubes

0

0 votes
Problem

Write a program, which repeatedly reads in a non-negative integer N and prints out 13 + 23 + ... + N3.


Input Format:
The first line of input would represent the value N


Output Format:
The line of output would be the result of the equation based on the task above


Reminder:
Include validation that when n < 0, the output will display, “Invalid input”

Sample Input
3
Sample Output
36
Time Limit: 2
Memory Limit: 256
Source Limit:
Contributers:
Editor Image

?