장효창의 낙서

[JAVA] 백준 10871번 : X보다 작은 수 본문

코딩 문제/백준

[JAVA] 백준 10871번 : X보다 작은 수

장효창 2022. 1. 7. 14:46
import java.util.Scanner;

public class bj10871 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int inputOne, inputTwo,temp;
        

        inputOne = scanner.nextInt();
        inputTwo = scanner.nextInt();

        for(int i=0;i<inputOne;i++){
            temp = scanner.nextInt();
            if (temp < inputTwo){
                System.out.print(temp + " ");
            }
        }

    }
}
Comments