> ");
int n = sc.nextInt();
System.out.print("X 입력 >> ");
int x = sc.nextInt();
ArrayListimport java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;
public class FindSmallerNumbers {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("N 입력 >> ");
int n = sc.nextInt();
System.out.print("X 입력 >> ");
int x = sc.nextInt();
ArrayList<Integer> numbers = new ArrayList<>();
ArrayList<Integer> result = new ArrayList<>();
// N개의 정수 입력 받기
for(int i = 1; i <= n; i++) {
System.out.print(i + "번째 정수 입력 >> ");
int num = sc.nextInt();
numbers.add(num);
// X보다 작은 수를 결과 리스트에 추가
if(num < x) {
result.add(num);
}
}
// 결과 출력
System.out.print("결과 >> ");
for(int num : result) {
System.out.print(num + " ");
}
}
}