You are given
The first line of input is an integer
In the given example, there are
6 inputs. 1, 2, 3, 5, 9, 6. The numbers 3, 9, 6 are multiples of 3.
Out put should be
3
9
6
Sample Input 1
6
1
2
3
5
9
6
Sample Output 1
3
9
6
Sample Input 2
4
1
3
6
8
Sample Output 2
3
6
n = int(input("Enter the number of integers\t"))
list1 = " "
for i in range(0, n ):
t = int(input())
if t % 3 == 0:
list1 += str(t) +" "
for row in list1:
print(row)
Comments
Leave a comment