CT368

The Gleaming Sum

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Caravans arrive at the mulberry rows of Silkmead with crates of crates, and Cyrus the assayer must account for every last one. 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 <= 72; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 67 -635951 -170493 -586890 -868499 -669839 -865802 -982435 -183831 -796076 -586812 -556340 -310792 -14690 -797631 -221397 -291920 -741189 -293954 -390453 -971261 -189781 -974350 -625349 -949224 -303764 -42480 -819639 -413984 -716476 -236693 -718121 -548835 -462634 -933739 -477597 -470507 -781746 -689890 -155529 -96584 -422139 -679072 -788649 -162528 -923740 -466058 -621629 -135515 -754085 -297899 -583534 -770321 -529424 -87301 -409469 -495218 -663266 -716562 -220997 -575533 -616250 -526499 -722654 -17661 -416603 -474179 -482853
Output: -35102815

Example 2:

Input: 1 -9887
Output: -9887

Example 3:

Input: 9 -350612 -849558 -779032 -485158 -993598 -960850 -788366 -404247 -326770
Output: -5938191

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Gleaming Sum - EASY Coding Problem | CodeTikki