#67. 统计数组中的偶数

    ID: 67 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatArray-2gesp1循环结构条件结构

统计数组中的偶数

Count Even Numbers

Background

Congcong is currently learning about arrays and basic mathematical operations. He encountered a problem where he needs to find the number of even integers in a given array.

Problem Description

Return the number of even integers in the given array. Note: the % "mod" operator computes the remainder, e.g. 5%25 \% 2 is 11.

Input Format

Input is given from standard input in the following format.

An array of integers, with elements separated by spaces.

Output Format

Output is printed to standard output in the following format.

An integer, representing the count of even numbers in the array.

Sample

[2 1 2 3 4]
3
[2 2 0]
3
[1 3 5]
0

Sample Explanation

For the first sample input [2 1 2 3 4], there are three even numbers: 2,2,42, 2, 4. Thus, the output is 33.

Constraints

Time limit: 11 second, Memory limit: 10241024 KiB for each test case.