2017년 10월 12일 목요일

[Java] When 'sc.nextLine()' doesn't work after 'sc.nextInt()'

[Solution]
int n = sc.nextInt();
sc.skip("[\\r\\n]+");
for(int i = 0 ; i < n ; i++){
   String str = sc.nextLine();
   System.out.println(str);
}

댓글 없음:

댓글 쓰기