OtherOA #9
Count Even Numbers
EasyJudge-ready
Topics (AI-labelled)In-place Arrays
Count the even numbers in an integer array. Although the source sentence is truncated, the constraints and three examples fully determine how negative numbers, 0, and the empty array are handled.
Input
The first line contains n (0≤n≤1000), and the second line contains n integers in the range −100000..100000.
Output
Output the number of even numbers in the array.
Example 1
Input:
5
1 2 4 7 10
Output:
3
Example 2
Input:
0
Output:
0
Example 3
Input:
5
-3 -2 0 5 8
Output:
3
Editorial
Loading solution…