Learning path · Algorithm Foundations
← Back to lesson · Direct reasoning홀수의 개수 구하기
Unrated
한국어
Language
Contribute a translation- Time limit
- 1000 ms
- Memory limit
- 256 MB
- Submissions
- 0
- Correct
- 0
- Solved by
- 0
- AC rate
- —
Statement
$n$개의 자연수를 입력받아 그중 홀수가 몇 개인지 순차 탐색으로 구하시오.
Input
첫째 줄에 자연수의 개수 $n$이 주어진다. ($1 \le n \le 100\,000$) 둘째 줄에 $n$개의 자연수가 공백을 사이에 두고 주어진다. 각 수는 $1\,000\,000\,000$ 이하이다.
Output
홀수의 개수를 한 줄에 출력한다.
Examples
Sample input 1
5 1 2 3 4 5
Sample output 1
3
Sample input 2
3 2 4 6
Sample output 2
0
Tags
No tags yet