CT896

Piper's Sum Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Morning light hits the lotus ponds of Tranquil Basin as Piper unrolls the day's manifest of scrolls. The tally will decide the next shipment. 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 <= 42; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 1 -13178
Output: -13178

Example 2:

Input: 28 816010 -740608 -907612 -961482 266351 -154251 782087 -105389 -77450 -568656 -394701 -571884 -348641 212765 -678378 -991110 984725 -806905 133587 861710 -456212 70183 353671 230566 831786 734493 -311741 -544392
Output: -2341478

Example 3:

Input: 12 -589196 -724753 83734 464591 -931072 -277643 -930990 -344867 -557340 61210 821480 -158743
Output: -3083589

Constraints:

1 <= n <= 42; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

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