So I wrote code that does not enter values into a column, but into a string:
Scanner sc2 = new Scanner(System.in); String scString2 = sc.nextLine(); String[] scStrings2 = scString2.split(" "); int[] scNumbers2 = new int[powyk1]; for(int i = 0; i < powyk1; i++) { if (Integer.valueOf(scStrings2[i])>0 && Integer.valueOf(scStrings2[i])<Math.pow(10,9)+7); scNumbers2[i] = Integer.valueOf(scStrings2[i]); } The data in the array are entered as follows:
2 2 3 4 5 6 And how to make sure that the data are entered in pairs:
2 2 4 5 6 7
;- remove firstly this afterif- Anton Sorokinnextint()for all. It will be much easier - Oleksiy Morenets