https://www.acmicpc.net/problem/10871
using System;
using System.IO;
namespace baekjoon
{
class Program
{
static void Main(string[] args)
{
// 표준 입출력 스트림 reader,writer 만들기
// 첫째 줄에 n과 x 입력받기 , 분리하기, int로 바꾸기
// 둘째 줄에 정수 n개 입력받기, 분리하기, int로 바꾸기,
// x 보다 낮은 수 구분하기
// 버퍼에 저장, 버퍼 한 번에 비우기
StreamReader sr = new StreamReader(Console.OpenStandardInput());
StreamWriter sw = new StreamWriter(Console.OpenStandardOutput());
string strFirstInput = sr.ReadLine();
string[] strNum = strFirstInput.Split(' ');
int nN = int.Parse(strNum[0]);
int nX = int.Parse(strNum[1]);
string strSecondInput = sr.ReadLine();
string[] strA = strSecondInput.Split(' ');
for (int i = 0; i < nN; i++)
{
int nA = int.Parse(strA[i]);
if (nA < nX)
{
sw.Write(nA);
sw.Write(" ");
}
}
sw.WriteLine();
sw.Flush();
sr.Close();
sw.Close();
}
}
}