CT23088

Cyrus's Even Count Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Every season at the boar woods of Tuskmore, someone must forecast next month's demand. This year the task falls to Cyrus, armed only with the tickets register. 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 <= 352; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 237 -6 -18 5 -32 -77 -53 -47 -90 -51 -46 -68 -50 -18 -45 -65 -12 -56 -64 -34 -38 7 -71 -91 -17 -80 -63 -25 -15 -80 -17 -63 -88 -88 -84 -91 -91 -36 -89 -100 -66 -56 -82 -36 -86 -47 -65 -29 -84 -97 5 -17 -58 -17 -85 -37 10 -4 -62 8 -63 -8 2 -83 -72 -82 -51 -64 -13 -67 6 -16 -1 -30 -26 -93 -18 -47 -10 -21 -100 -53 -20 -22 -28 -92 -59 -39 -35 -38 -61 -7 -48 -60 -83 -54 -33 -79 -18 -51 -55 -41 -55 -69 -25 6 3 -10 -43 -71 -44 -12 6 -67 -52 -54 -95 -53 -84 -73 -89 -45 -43 -47 -99 8 -86 3 -62 -53 -51 -39 -87 -77 -70 -37 -48 -68 -10 -21 -3 -26 -85 2 -95 -81 -64 -13 -19 -17 -74 1 8 -89 -88 -20 -16 -48 -58 8 -70 -89 10 -63 -70 -74 -85 -22 -13 -79 -68 -74 -41 -91 -57 -89 -25 -71 -98 -69 -70 -13 -4 9 -87 -93 -40 -84 -78 6 -7 -14 -30 -96 -37 -65 -55 -31 -35 -64 5 -68 -28 -86 -51 1 -48 -13 -87 -81 -40 -8…
Output: 110

Example 2:

Input: 278 8 10 -34 -43 -49 -53 -9 -59 -90 -4 6 -20 -36 -1 -79 -94 -66 -43 -91 -19 -39 -77 -64 -79 9 -20 -51 -80 -40 -22 -18 -85 -91 -56 -58 -34 -23 -82 0 -17 -24 -67 -52 -83 -9 -99 -81 9 6 -36 -70 -63 -10 -19 -63 -35 -30 -3 -2 -40 -22 -1 -69 -78 -38 -93 -28 -26 -26 -20 -7 -63 -33 10 -36 -61 -17 7 -79 -38 -99 -5 -10 -92 9 -12 -49 -20 -39 -69 -42 -5 -48 -75 -12 -66 -72 -76 -42 -23 6 -41 -11 -35 -44 -14 -67 -100 -43 -69 -66 -20 -66 -68 -55 -83 -47 -54 -50 -44 -76 5 -58 -34 8 -55 -39 -42 -66 -22 -44 -32 -54 -66 -2 -88 -62 -93 8 -80 -5 -75 -45 -58 -17 -26 -3 4 -40 -10 -18 -45 -28 -95 -25 -26 -79 -10 -74 -39 1 -93 -39 2 -20 -99 -21 -65 -29 -12 -68 -97 -80 -18 -98 -99 -49 -42 -49 -95 -7 -10 -16 -40 -72 -21 -96 -32 -95 -19 -42 -41 -15 -4 -45 -68 -78 -97 -44 -52 -79 -78 -79 -24 -27 -45 -17 -43 -70 -89 -1…
Output: 150

Example 3:

Input: 61 -13 -6 -66 2 -14 -29 -63 -47 -68 3 2 -5 -58 -61 -83 -27 -29 -80 -12 -47 -87 -86 10 -73 -32 -26 -83 -29 2 -67 -96 -32 -79 -80 -24 -17 -65 4 6 -34 -34 -39 -3 -94 -81 -37 -36 -15 -51 -92 -85 8 -100 -62 -12 -7 -30 -75 -44 7 -76
Output: 32

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Cyrus's Even Count Ledger - EASY Coding Problem | CodeTikki