CT25452

Rowena and the Sum

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the glass towers of Prismhaven. Rowena spreads the coins records across the table and picks up a sharp pencil. Task: Read n integers and print their total sum. Input format: First line: n. Second line: n space-separated integers. Output format: Print the sum of all n values. Constraints: 1 <= n <= 259; 0 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 127 0 3 3 6 6 3 8 8 3 5 4 9 4 7 1 6 10 4 4 7 0 7 6 7 6 3 6 7 9 1 9 1 10 1 9 1 6 5 4 8 8 10 8 2 3 5 4 0 1 5 8 7 3 1 9 5 1 7 9 1 4 0 7 3 4 0 7 7 3 6 3 9 2 0 10 0 7 5 6 5 2 9 6 8 2 4 0 2 4 9 3 7 7 7 0 9 6 9 4 2 6 2 8 8 10 10 6 4 10 8 7 8 3 8 9 4 5 9 7 3 3 7 8 5 5 1 0
Output: 656

Example 2:

Input: 217 1 10 5 8 2 5 2 9 10 1 6 5 8 5 5 0 2 0 0 10 10 0 1 0 5 2 8 0 6 3 0 0 2 1 4 10 7 4 3 10 4 1 5 0 4 6 9 0 4 5 4 8 7 2 4 2 6 9 1 0 10 4 10 10 3 2 7 8 8 9 10 3 8 7 9 6 5 0 5 4 10 8 1 2 4 9 5 10 5 10 0 1 4 5 10 4 7 2 3 5 7 7 5 9 7 7 3 7 6 1 7 4 4 5 5 3 5 7 10 6 4 0 5 3 8 2 9 2 10 6 5 4 1 7 4 10 1 9 1 2 0 3 6 4 9 8 3 1 0 6 10 9 9 7 10 6 2 8 2 6 0 1 0 0 10 1 4 9 0 2 5 8 2 10 10 9 2 8 5 5 7 9 2 4 4 3 6 8 10 2 1 6 0 4 0 1 3 5 9 9 4 2 4 8 4 9 2 1 4 2 6 4 1 4 4 4 7
Output: 1055

Example 3:

Input: 161 6 1 0 5 4 5 1 7 8 5 9 5 1 6 10 4 3 2 7 9 9 4 1 7 5 3 5 2 5 8 4 2 10 6 4 3 4 3 7 8 4 1 2 5 9 5 9 5 3 1 4 6 6 7 6 9 4 7 4 8 1 8 9 8 3 6 10 4 0 5 3 1 6 5 5 4 2 4 4 10 1 6 5 4 5 8 8 1 2 10 9 6 6 5 0 8 6 0 7 7 5 9 8 8 9 4 6 2 1 10 7 8 0 9 10 9 7 2 3 1 0 1 8 8 6 4 9 10 0 10 5 7 3 8 1 6 9 2 3 3 6 8 4 8 9 10 9 9 10 9 1 3 0 9 4 10 8 4 8 0 3
Output: 858

Constraints:

1 <= n <= 259; 0 <= a[i] <= 10; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.