CT28064

The Crystal Even Values Sum

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Herald runs the counting house at the anvil district of Hammerfall. Today the books show a list of ingots, and the numbers must be worked out before sundown. 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 <= 865; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 580 156899197 247402390 116540821 276995260 59123675 571939729 584091005 656311615 654749949 505536600 752247712 229737587 351465073 219276623 965285458 692761796 994980758 370823828 669842378 614961382 31369268 390630968 329708232 877333694 44518726 845876054 464884966 184529091 459696777 468873456 74099479 244599965 399689490 991984893 247227007 386356740 836405175 707479632 158621436 82597796 573746772 205875044 221198188 254782283 70103759 972971315 976932481 423220894 367844894 36702637 602026235 570553435 44192691 348663528 64529514 420856979 383887137 635565078 429027482 840787963 144133570 292000687 704792633 114728511 518994999 198001586 710614120 48683476 107112826 347514647 808460302 850372260 185215025 765313070 956342733 247618026 180800873 229000459 600474934 807356481 966579…
Output: 146492308962

Example 2:

Input: 649 617053451 512271120 354835771 408903205 824556960 142983234 757090642 26406573 217882521 836547451 92941731 565970190 293605121 534179325 641508300 791856728 538185310 987686205 539015205 146730017 336619858 386059342 90519922 187521698 106170453 564636098 338622971 134863192 294959535 98044733 653181768 278682741 85457367 869764714 657064631 866616906 924564406 667418872 127623499 679772921 890185854 963767745 664340951 548097904 243765260 771547301 21531440 47736249 577192285 333933496 354897394 921598351 148729826 519202832 856720481 875975410 3219305 465893152 303517967 255879561 264379995 351561524 96516437 114375406 850662047 302321927 928984908 654622870 343950650 235266310 794434359 975544504 895582637 130908993 84912137 492968949 873029942 589359538 568367619 954438989 7188882…
Output: 157183954216

Example 3:

Input: 5 788777884 932177536 704598191 47942073 303374445
Output: 1720955420

Constraints:

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

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