1.使用Scanner
Scanner sc = new Scanner(System.in);
如果要输入整数,则 int n = sc.nextInt();
String类型的,则String temp = sc.next();2.使用BufferedReader
BufferedReader br = new BufferedReader( new InputStreamReader(System.in) );String input = br.readLine();
本文共 241 字,大约阅读时间需要 1 分钟。
1.使用Scanner
Scanner sc = new Scanner(System.in);
如果要输入整数,则 int n = sc.nextInt();
String类型的,则String temp = sc.next();2.使用BufferedReader
BufferedReader br = new BufferedReader( new InputStreamReader(System.in) );String input = br.readLine();
转载地址:http://fwiso.baihongyu.com/