CT819

Sailor's Sum Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The harbor bell rings at the fjord village of Deepwater; Sailor weighs the day's tickets manifests and starts the calculations. 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 <= 38; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 28 247957 212525 204586 -97536 509178 -919782 80894 -903611 825637 -455814 -320814 -46508 -177019 428617 156648 461341 754812 -80440 490568 735930 -333876 577633 162978 671163 614305 -484049 973598 954473
Output: 5243394

Example 2:

Input: 21 542119 215013 534941 -108697 315176 451226 238666 -428891 105374 597808 552889 330747 -614777 -801321 874537 449934 997433 280307 918637 -673812 722415
Output: 5499724

Example 3:

Input: 21 -919651 -724179 -645414 -210374 525020 564054 76292 920356 44667 748481 -283729 223253 752488 454912 -108930 278683 -748855 -355653 500715 494565 -384717
Output: 1201984

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Sailor's Sum Ledger - EASY Coding Problem | CodeTikki