2166: 奇数和偶数(2024年12月C++一级)

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:109 Solved:66

Description

⼩杨有 n 个正整数,他想知道其中的奇数有多少个,偶数有多少个。

Input

第⼀⾏包含⼀个正整数 n ,代表正整数个数。
之后 n ⾏,每⾏包含⼀个正整数。

Output

输出两个正整数(⽤英⽂空格间隔),代表奇数的个数和偶数的个数。如奇数或偶数的个数为0,则对应输出0。

Sample Input Copy

5
1
2
3
4
5

Sample Output Copy

3 2

HINT

对于全部数据,保证有 1<=n<=105 且正整数⼤⼩不超过  105

Source/Category