public static void readIntMatrix(InputReader in, int[][] matrix) { for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix[i].length; j++) { matrix[i][j] = in.nextInt(); } } }
public static void readIntArrays(InputReader in, int[]... arrays) { for (int i = 0; i < arrays[0].length; i++) { for (int j = 0; j < arrays.length; j++) { arrays[j][i] = in.nextInt(); } } }
public static void readCharMatrix(InputReader in, char[][] matrix) { for (int i = 0; i < matrix.length; i++) { String row = in.next(); for (int j = 0; j < matrix[i].length; j++) { matrix[i][j] = row.charAt(j); } } }