CT1272

Last scrolls of Opal

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Morning light hits the tundra station of Whitesnow as Opal unrolls the day's manifest of scrolls. The tally will decide the next shipment. Task: Read n integers and print the sum of all even values. Input format: First line: n. Second line: n space-separated integers. Output format: Print the sum of even values (0 if none). Constraints: 1 <= n <= 49; -100 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 6 662820 180282 647077 916869 391877 962446
Output: 1805548

Example 2:

Input: 45 397626 113878 619352 775026 371785 169919 545835 95455 813280 871118 473149 727001 916126 280748 253087 621123 692905 812828 71410 525349 684408 596940 793585 437593 341006 320023 818757 306812 328305 334368 194507 638940 687572 756039 914258 570485 542243 673241 600298 250740 125880 283147 191158 401690 663847
Output: 11745462

Example 3:

Input: 46 32045 104488 710105 741618 102455 692139 87495 27895 505857 278773 77410 593172 601112 981783 536589 266985 171260 683915 246982 699603 104585 618368 618185 215264 528069 462844 973200 360648 993278 330272 870580 823864 396898 266172 823438 718743 633086 256443 34437 702059 450819 745519 887613 216330 251138 301180
Output: 11072602

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Last scrolls of Opal - EASY Coding Problem | CodeTikki