Write a program that reads integers (one per line) from the console until their sum is equal to 0. After that, the program should display the sum of the squares of all the entered numbers.
It is guaranteed that at some point the sum of the entered numbers will be equal to 0. After that, you should stop reading the input.
In case the first integer equals 0, just print out 0 instead of the sum of the squares.
You only need to output the sum of the squares once.
Example:
Input (the greater-than symbol followed by space > represents the user input, it's not part of the input):
> 4
> -10
> 6
Output (the sum of squares of numbers 4, -10, and 6):
152