CT2251

The Even Values Sum of Luminar

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Caravans arrive at the crystal caves of Luminar with crates of readings, and Curator the bookkeeper must account for every last one. 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 <= 52; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 40 595 51 357 487 410 624 978 441 569 76 495 383 445 848 256 124 765 404 408 243 496 811 332 325 96 -44 263 64 711 419 172 349 552 404 394 163 677 473 940 605
Output: 7534

Example 2:

Input: 28 563 580 355 643 792 987 914 -73 -69 740 -24 688 -59 -68 592 979 156 236 571 542 89 790 415 680 833 200 398 319
Output: 7216

Example 3:

Input: 51 856 417 125 -34 560 323 386 598 303 969 453 845 823 -60 844 941 295 233 590 805 764 967 105 525 792 11 804 926 558 109 223 99 -33 -61 296 634 783 -49 869 738 292 35 550 772 855 523 457 530 473 240 540
Output: 12176

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Even Values Sum of Luminar - EASY Coding Problem | CodeTikki