In what concerns the continuous evaluation solving exercises grade during the semester, you should submit until 23:59 of October 19th
(this exercise will still be available for submission after that deadline, but without couting towards your grade)
[to understand the context of this problem, you should read the class #02 exercise sheet]
Everyone knows that 42 is the answer to the ultimate question of life, the universe, and everything. Now you just to make a program that puts that in practice!
Given a sequence of Q integer numbers, your task is to count the amount of times the number 42 appears.
The first line of input contains Q, the quantity of numbers to process.
The second line of input contains Q integer numbers ni, separated by single spaces.
A single line containing the amount of times the number 42 appears, that is, how many of the ni numbers are equal to 42.
The following limits are guaranteed in all the test cases that will be given to your program:
1 ≤ Q ≤ 100 | Quantity of numbers to consider | |
1 ≤ ni ≤ 109 | Range of each number |
Example Input 1 | Example Output 1 |
7 2 42 42 6 42 999 5 |
3 |
In this example there are three 42's in the numbers given.
Example Input 2 | Example Output 2 |
5 78 234 1024 1 14 |
0 |
In this first example there are no 42's in the numbers given.