Answer:
The program in Python is as follows:
num = int(input())
numList = []
for i in range(num+1):
numInput = int(input())
numList.append(numInput)
for i in range(len(numList)-1):
if numList[i] <= numList[-1]:
print(numList[i],end=" ")
Step-by-step explanation:
This gets input for the number of integers
num = int(input())
This initializes an empty list
numList = []
This iterates through the number of integers and gets input for each
for i in range(num+1):
numInput = int(input())
The inputs including the threshold are appended to the list
numList.append(numInput)
This iterates through the list
for i in range(len(numList)-1):
All inputs less than or equal to the threshold are printed
if numList[i] <= numList[-1]:
print(numList[i],end=" ")