Baekjoon 10871
X보다 작은 수


QUESTION ❔



CODE ⌨️

#include <iostream>
#include <vector>

using namespace std;

int N, cmp, num;
vector<int> arr;
vector<int> answer;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> N >> cmp;

	for (int i = 0; i < N; i++)
	{
		cin >> num;

		arr.push_back(num);
	}

	for (int i = 0; i < N; i++)
	{
		if (arr[i] < cmp)
		{
			answer.push_back(arr[i]);
		}
	}

	for (int i = 0; i < answer.size(); i++)
	{
		cout << answer[i] << " ";
	}

	cout << "\n";

	return 0;
}



RESULT 💛



SIMPLE DISCUSSION ✏️

수학 관련 쉬운 문제였다.



SOURCE 💎

Baekjoon_Link 👈 Click here


*****
NOT A TALENT ❎ NOT GIVING UP ✅
CopyRight ⓒ 2022 DCherish All Rights Reserved.