Back
Close

Sum of Positive Numbers

Statement
Your task is to print the sum of all positive integer in an array [[a]]

Input description
An integer [[n]], the size of array An array [[a]], contains negative and positive integers.

Output description
The sum of all positive integers in an array [[a]]

Constraints
1 < [[n]] < 10 1 < len([[a]]) < 10

Game modes
Fastest, Shortest, Reverse

Test cases
Test 1 Test
Input
5 1 -1 2 -2 3
Output
6

Validator 1 Validator
Input
3 1 2 -3
Output
3

Test 2 Test
Input
4 3 -4 -5 1
Output
4

Validator 2 Validator
Input
2 -1 -2
Output
0

Test 3 Test
Input
3 -1 1 -1
Output
1

Validator 3 Validator
Input
4 1 2 3 4
Output
10

Test 4 Test
Input
5 100 -100 -50 -2 10
Output
110

Validator 4 Validator
Input
3 1 199 100
Output
300

Solution language

Solution

Stub generator input