nextInt()후 개행제거

김덕근·2022년 12월 18일
0

concept

목록 보기
6/21

Scanner sc = new Scanner(System.in);

int num = sc.nextInt();
sc.nextLine();

nextInt(); 입력 버퍼에 남은 개행을
nextLine(); 으로 입력받아 제거한다.

profile
안녕하세요!

0개의 댓글