728x90

https://www.acmicpc.net/problem/10871

😢 N개의 수열을 받아서 X보다 작은지 판단하는 문제

😊 N, X을 먼저 입력받고, N만큼 loop, a는 X보다 작은지 판단하여 출력

#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int N, X;
cin >> N >> X;
for (int i = 0; i < N; i++) {
int a;
cin >> a;
if (a < X) cout << a << ' ';
}
}
view raw 10871.cpp hosted with ❤ by GitHub

+ Recent posts