#C14719. Count Numbers Challenge
Count Numbers Challenge
Count Numbers Challenge
You are given a list of integers. Your task is to count the number of positive, negative, and zero elements in the list. Formally, if the list is represented as \( a_1, a_2, \ldots, a_n \), you need to compute the following:
\( positive = \sum_{i=1}^{n} [a_i > 0] \)
\( negative = \sum_{i=1}^{n} [a_i < 0] \)
\( zero = \sum_{i=1}^{n} [a_i = 0] \)
Here, the notation \([P]\) equals 1 if the condition \( P \) is true, and 0 otherwise.
The input is provided via standard input (stdin) and the output should be printed to standard output (stdout) with the three counts separated by spaces.
inputFormat
The first line contains an integer \( n \), representing the number of elements in the list. The second line contains \( n \) space-separated integers.
If \( n = 0 \), then the second line might be empty.
outputFormat
Output three integers separated by a single space. The first integer is the count of positive numbers, the second is the count of negative numbers, and the third is the count of zeroes.
## sample8
1 -1 2 0 -3 5 0 -8
3 3 2