Sumar els parells
Submit solution
Points:
10
Time limit:
5.0s
Memory limit:
256M
Author:
Problem types
Allowed languages
C#, Go, Java
Escriu un programa que llegeixi una llista de \(N\) nombres enters de la consola i retorni la suma de tots els nombres parells de la llista.
Input Format
Primera línia:
- \(N\): la quantitat de nombres enters que contindrà la llista.
Segona línia:
- Una seqüència de \(N\) nombres enters, separats per un espai en blanc.
Constraints
- \(N > 1\)
Output Format
El resultat de sumar els nombres parells de la llista.
Sample Input 0
10
1 2 3 4 5 6 7 8 9 10
Sample Output 0
30
Sample Input 1
10
1 2 3 4 7 6 11 13 8 10
Sample Output 1
30
Sample Input 2
10
2 4 6 8 10 12 14 16 18 20
Sample Output 2
110
Sample Input 3
5
1 3 5 7 9
Sample Output 3
0
Sample Input 4
8
8 7 6 5 4 3 2 1
Sample Output 4
20
Sample Input 5
10
-1 -2 -3 -4 -5 -6 -7 -8 -9 -10
Sample Output 5
-30
Sample Input 6
1
7
Sample Output 6
0