#C12749. Filter Prime Numbers
Filter Prime Numbers
Filter Prime Numbers
You are given a list of integers. Your task is to filter out the prime numbers and print them in the order they appear in the input. A number \(n\) is called prime if:
\(n > 1\) and there is no integer \(d\) with \(2 \leq d \leq \sqrt{n}\) that divides \(n\) evenly.
If there are no prime numbers in the input, simply output an empty line.
inputFormat
The first line of input contains a single integer \(N\) indicating the number of integers. The second line contains \(N\) integers separated by spaces.
outputFormat
Output the prime numbers (if any) separated by a single space in one line. If there are no prime numbers, output an empty line.
## sample9
2 3 4 5 6 7 8 9 10
2 3 5 7
</p>