CT2226

The coins at Starfall

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Before the gates of the observatory of Starfall close for winter, Ulrica must finish the coins ledger - one figure at a time. 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 <= 43; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 36 960631 126887 141871 965439 832779 520065 -64478 -98187 -281040 262419 467236 -753626 21018 -366059 -67733 -894371 119585 311611 809830 138224 -211217 293634 -232869 509551 925023 696019 926185 170399 -834020 220687 -47217 -683861 -981422 -218840 580520 -245501
Output: 4019172

Example 2:

Input: 34 -872037 777713 -870205 635477 737938 848075 483110 -808428 -814405 530447 910674 -927837 -857532 -869114 530379 -849614 -310525 916789 893517 422945 -768796 123611 876720 878968 -720670 -539795 -966196 -50003 -377573 -115667 438981 -474022 -637976 529268
Output: -1295783

Example 3:

Input: 31 666188 301471 856931 -531932 -987150 161932 219227 875054 -423470 -787927 -879490 -172303 -493754 -702718 251955 719152 -861011 944585 -16746 -571374 146574 -930834 516357 -732837 325142 -3657 545157 60540 -234917 -563136 -275787
Output: -2578778

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The coins at Starfall - EASY Coding Problem | CodeTikki