Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String[] sizeInput = reader.readLine().split(" ");
- final int rows = Integer.parseInt(sizeInput[0]);
- final int cols = Integer.parseInt(sizeInput[1]);
- int[][] field = new int[rows][];
- int currentRow = 0;
- int currentCol = 0;
- for (int i = 0; i < field.length; i++) {
- String[] inputRow = reader.readLine().split(" ");
- field[i] = new int[inputRow.length];
- for (int j = 0; j < field[i].length; j++) {
- field[i][j] = Integer.parseInt(inputRow[j]);
- if (field[i][j] == 0) {
- currentRow = i;
- currentCol = j;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement