1 Scanner scan = new Scanner(System.in); 2 String s = scan.nextLine(); 3 Scanner sc = new Scanner(s); 4 List<Integer> input = new ArrayList<>(); 5 while(sc.hasNext()){ 6 input.add(sc.nextInt()); 7 }
原文:https://www.cnblogs.com/dretrtg/p/13876830.html