public static void main(String[] args) { readData(); } public static void readData() { //напишите тут ваш код List<Integer>list= new ArrayList<>(); Scanner scan=new Scanner(System.in); try { int number=scan.nextInt(); while(scan.hasNext()){ list.add(scan.nextInt()); } } catch (Exception e) { for(Integer value:list){ System.out.println(value); } } } }