CT2005

The Roving lanterns of Quartermaster

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Quartermaster the measurer watches over the cork grove of Barkhaven's stores of lanterns. A careful computation stands between order and chaos. Task: Read n integers and print how many are even. Input format: First line: n. Second line: n space-separated integers. Output format: Print the count of even values. Constraints: 1 <= n <= 38; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 13 43 483 726 413 959 185 747 981 878 336 559 145 886
Output: 4

Example 2:

Input: 31 350 713 -1 638 585 892 422 323 134 521 488 256 175 842 7 570 401 595 472 97 616 455 649 183 206 463 506 243 748 227 601
Output: 14

Example 3:

Input: 37 640 534 1000 604 604 704 602 -14 787 841 -68 281 328 92 928 412 467 393 165 152 1000 110 355 903 258 547 688 57 -18 479 867 933 307 119 570 545 773
Output: 20

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.