Given a list of integers, compute the sum of the nonzero ones.
In the event the list contains no nonzero integers, the desired sum is zero.
Constraints
In tests worth 5 marks, all
Input Specification
The first line contains a single integer
The next
Output Specification
On a single line, output the sum of the nonzero integers.
Sample Input 1
Copy
10
0
0
0
0
0
0
0
0
0
0
Sample Output 1
Copy
0
Sample Input 2
Copy
2
1
-2
Sample Output 2
Copy
-1
Comments
if you guys are getting a "Presentation error: check your whitespace" put a new line after you output the sum of the list
A few questions: Why do we get 1G and what's the point of emphasizing non-zero Integers, even if you were to add them, it would't make a difference.
Ohhh I get it now, thanks for telling me