方法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();
原文地址:https://www.cnblogs.com/blzm742624643/p/12229337.html
时间: 2024-11-08 10:54:21