#C12703. Divisible Numbers Filter
Divisible Numbers Filter
Divisible Numbers Filter
You are given an integer n and a list of integers. Your task is to print, in their original order, all the numbers from the list that are divisible by n.
If n is zero, you must output ZeroDivisionError
(without quotes). Otherwise, if no number in the list is divisible by n, print an empty line.
Note: The input is given from the standard input (stdin) and the output must be written to the standard output (stdout).
inputFormat
The first line contains an integer n. The second line contains a space‐separated list of integers.
Constraint: It is possible that n is 0, in which case your program should output ZeroDivisionError
.
outputFormat
If n is not 0, print all the numbers from the list that are divisible by n, preserving their original order, with a single space separating them. If no number is divisible, print an empty line. If n is 0, print ZeroDivisionError
.
3
3 1 4 9 6 10
3 9 6
</p>