#C13315. Prime Filter
Prime Filter
Prime Filter
In this problem, you are given a list of integers. Your task is to filter out and output only the prime numbers from the list. A prime number is an integer greater than 1 that has no positive divisors other than 1 and itself; that is, a number ( n ) is prime if and only if ( n > 1 ) and for every integer ( d ) such that ( 2 \leq d \leq \sqrt{n} ), ( d ) does not divide ( n ).
Your solution should read input from standard input (stdin) and write the result to standard output (stdout). The output should preserve the order of appearance of the prime numbers in the input. If no prime numbers are found, print an empty line.
inputFormat
The first line of input contains a single integer ( n ), representing the number of integers in the list. The second line contains ( n ) space-separated integers.
outputFormat
Output a single line containing the prime numbers from the input list, separated by a single space. If there are no prime numbers, output an empty line.## sample
6
10 15 3 7 9 11
3 7 11
</p>