728x90

😢 N개의 수열을 받아서 X보다 작은지 판단하는 문제
😊 N, X을 먼저 입력받고, N만큼 loop, a는 X보다 작은지 판단하여 출력
This file contains 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
#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 << ' '; | |
} | |
} |
'Algorithm > C&C++' 카테고리의 다른 글
백준 1000번: A+B(c++) (0) | 2021.09.27 |
---|---|
백준 2752번: 세수정렬 c++(cpp) (0) | 2021.09.06 |
백준 10804번: 카드 역배치 c++(cpp) (0) | 2021.09.02 |
백준 2440번: 별 찍기 - 3 c++(cpp) (0) | 2021.09.01 |
백준 2439번: 별 찍기 - 2 c++(cpp) (0) | 2021.08.31 |