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