方法1:通过Scanner
Scanner input = new Scanner(System. in); String S = input .nextLine(); input. close();
方法2:通过BufferedReader
BufferedReader input = new BufferedReader(new InputStreamReader(System. in)); String S = input.readLine();
方法1:通过Scanner
Scanner input = new Scanner(System. in); String S = input .nextLine(); input. close();
方法2:通过BufferedReader
BufferedReader input = new BufferedReader(new InputStreamReader(System. in)); String S = input.readLine();