CT22832

The barrels Sum Puzzle

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the lantern district of Glowfen. Quade spreads the barrels 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 <= 200; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 181 -28 -34 -39 -49 3 -21 3 -2 -53 10 -1 10 -86 3 -45 5 -53 -3 -59 -53 -12 10 -69 -99 -34 4 -59 -29 -56 -10 -40 -89 0 -19 -27 7 -36 -69 -43 -99 -5 -81 -47 -89 7 -23 2 -29 -35 -93 -81 -25 6 -13 -33 -4 -7 -93 -49 0 -87 -69 -25 -82 -31 -27 -71 -64 -37 -17 -77 -71 -9 -46 -54 -13 -35 -36 -55 -51 -34 -55 -28 -30 -70 -54 -98 -72 -38 -72 -35 -20 -39 -84 -54 -35 -1 -41 -16 -96 -68 -71 -33 -15 -11 -93 -48 -46 -58 -63 -13 -56 -92 -58 -57 4 -61 1 10 0 -16 -79 -27 -43 -21 -20 -31 -94 -95 -77 -28 -77 -36 -79 -76 -65 -16 2 -29 -87 -2 -82 -61 0 -18 -98 8 -7 -52 -18 -92 -76 -54 -18 -69 -74 -24 -91 -70 10 -18 -60 -75 -88 -71 -43 -61 -18 -14 -83 -41 -10 -86 -25 -66 -32 -64 -23 1 -85 -47
Output: -7601

Example 2:

Input: 93 -52 -23 -73 -88 -67 -4 -57 -12 -17 -38 -23 -82 -19 -52 -92 -34 -3 -41 -51 -26 -85 -43 -40 -50 -51 -67 -10 -42 -69 -19 -67 3 -90 -94 -21 -33 -5 -5 -91 -18 -3 -5 -90 -74 -90 -93 -86 -40 -36 -76 -33 -99 -7 -39 -24 -50 -91 -15 -78 -43 -70 -2 6 2 2 -97 10 -57 -10 -5 -80 3 -82 -99 -53 -18 -7 -41 -69 -90 -84 -56 -49 -83 -34 -56 -94 -38 -82 -39 -8 -4 -60
Output: -4267

Example 3:

Input: 23 -19 -86 6 -12 -70 -66 2 -56 -53 -47 -24 -91 -98 -7 -97 -29 -17 -7 -57 -37 -27 -85 -14
Output: -991

Constraints:

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

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