#K71467. Sum of Array Elements

    ID: 33538 Type: Default 1000ms 256MiB

Sum of Array Elements

Sum of Array Elements

You are given an array of integers. Your task is to compute the sum of all the elements in the array.

The problem is defined as follows: given an array \(a_1, a_2, \ldots, a_n\), find the sum \[ S = \sum_{i=1}^{n} a_i \] and output the result.

The input is provided via standard input (stdin), and you should write the answer to standard output (stdout).

inputFormat

The first line contains an integer \(n\) which represents the number of elements in the array.

The second line contains \(n\) space-separated integers \(a_1, a_2, \ldots, a_n\).

outputFormat

Output a single integer which is the sum of all the array elements.

## sample
4
1 2 3 4
10