~/algor $ cat problems/massiv-toq-elementlar-yigindisi
Sum of odd elements
Easy
1000 ms
128 MB
22%
A positive integer $n$ and an array of $n$ integers are given. Compute the sum of all array elements with odd values.
Input
The first line contains a positive integer $n$. The second line contains $n$ integers separated by spaces.
Output
One integer — the sum of the odd elements ($0$ if there are none).
Note
$1 \le n \le 1000$
$-10^{8} \le a_{i} \le 10^{8}$
Examples
Input #1
5 3 4 7 8 5
Output #1
15
Input #2
4 2 4 6 8
Output #2
0