## 문제
BOJ 10871 X보다 작은 수
## 풀이
N개 정수 X보다 작은 수
A에서 X보다 작은수 모두 출력
입력받은 순서대로 공백으로 구분해 출력하기.
X보다 작은 수는 적어도 하나 존재한다고 한다.
## 코드
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
input = sys.stdin.readline | |
tmp = input().split() | |
N_input = int(tmp[0]) | |
X_input = int(tmp[1]) | |
tmp_X = list(map(int,input().split())) | |
result = [] | |
for k in tmp_X: | |
if k < X_input: | |
result += [str(k)] | |
print(' '.join(result)) |
입력받은 N을 사용하지 않았는데 C에서는 배열 만들때 사용해야될 것으로 보인다.
0 댓글