CT1586

Jaya's Even Values Sum Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Before the gates of the beacon hill of Lantern Tor close for winter, Jaya must finish the readings ledger - one figure at a time. 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 <= 41; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 17 763363867 825305036 20913142 856197770 119450418 326806391 148175704 877703665 671174107 578764266 968356408 372163590 534144154 997376525 759607301 937702128 879694143
Output: 5361172616

Example 2:

Input: 28 669339737 483864169 963710531 155930159 553503725 725964526 693337975 139155623 347574995 828506874 616605727 716486067 963634059 485998009 435233045 528896352 384741952 673114176 279680686 931044033 430957547 528082612 389350908 72251107 390112531 120821375 547592583 535273419
Output: 4338338086

Example 3:

Input: 23 485664835 88938925 386892823 228231770 778336311 28231096 703845570 49252768 110589456 593268242 782536942 872869077 722048474 661468913 482132070 626965922 72598168 486172265 191592948 774716642 986350225 14292561 593155262
Output: 5959165330

Constraints:

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

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