#C12977. 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 output them in the same order as they appear in the input.
A prime number is defined as an integer \( n \) such that \( n > 1 \) and it has no positive divisors other than 1 and itself. Formally, \( n \) is prime if for every integer \( i \) with \( 2 \le i \le \sqrt{n} \), \( n \) is not divisible by \( i \). (Here, \( \sqrt{n} \) denotes the square root of \( n \).)
If the input contains no prime numbers, simply output an empty line.
inputFormat
The input consists of a single line containing a sequence of space-separated integers.
outputFormat
Output the prime numbers from the input in the order they appear, separated by a single space. If there are no prime numbers, print an empty line.
## sample2 4 6 7 9 11 13
2 7 11 13