方法一,通过Scanner
Scanner input = new Scanner(System.in);
String s = input.nextLine();
input.close();
方法二,通过BufferedReader
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
String s = input.readLine();
方法一,通过Scanner
Scanner input = new Scanner(System.in);
String s = input.nextLine();
input.close();
方法二,通过BufferedReader
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
String s = input.readLine();