Scanner 使用时要根据需要来选择不同的next方法,如: int a = sc.nextInt();//接收整型数据 int a = sc.nextLine();//接收String类型数据 可根据需要在API中查看Scanner;