Scanner sc = new Scanner(System.in);
int num = sc.nextInt(); sc.nextLine();
nextInt(); 입력 버퍼에 남은 개행을 nextLine(); 으로 입력받아 제거한다.