输入一行,然后按回车键结束此行的输入
Scanner in = new Scanner(System.in);
String line = in.nextLine();
Scanner in2 = new Scanner(line);
//输入第一行
while (in2.hasNextInt()) {
exp1.add(in2.nextInt());
}
String line1 = in.nextLine();
Scanner in3 = new Scanner(line1);
//输入第二行
while (in3.hasNextInt()) {
exp2.add(in3.nextInt());
}