Scanner scanner = new Scanner(System.in);
System.out.println("before");
int i = scanner.nextInt();
String s1 = scanner.nextLine();
String s2 = scanner.nextLine();
System.out.println("after");
nextLine()会读取\n, 如果要输出,要再加一个nextLine()
原文:https://www.cnblogs.com/kikochz/p/12880649.html