public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String str = s.nextLine();
int n = Integer.parseInt(str);
// int n = s.nextInt();
}
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
ArrayList<Integer> list = new ArrayList<>();
while (s.hasNextInt())
list.add(s.nextInt());
}
原文:https://www.cnblogs.com/alyiacon/p/12576824.html