CT1994

The Lunar Even Count

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The council of the ink district of Scriptoria pays by the answer, and Ulmar intends to earn it. First: the full register of scrolls. 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 <= 42; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 31 -727390 -633500 -243572 -666492 -516202 -502611 -565416 -8648 -502676 -680427 -79168 -951687 -850447 -466605 -990869 -486256 -7278 -658360 -112502 -590064 -546289 -616884 -532627 -754729 -209062 -12064 -410454 -883405 -75034 -632997 -330500
Output: 20

Example 2:

Input: 38 -88108 -903453 -874704 -123361 -861507 -590752 -60987 -910798 -499318 -371738 -632340 -480259 -244930 -753618 -981720 -128127 -423189 -986471 -775693 -126554 -869891 -626516 -294259 -604334 -789841 -382090 -231927 -136688 -748820 -973587 -67037 -117654 -24480 -203932 -965653 -751887 -206848 -501028
Output: 21

Example 3:

Input: 41 -91382 -608864 -815895 -725429 -843410 -971089 -698439 -185412 -541863 -156505 -815943 -23451 -178012 -901473 -516767 -380054 -350161 -143903 -366614 -739837 -726846 -579448 -514887 -859761 -3920 -494671 -945619 -796459 -750190 -339970 -105975 -346912 -822918 -372326 -472054 -252992 -386789 -498788 -376522 -790444 -532022
Output: 21

Constraints:

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

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