Advertisement
Guest User

Untitled

a guest
Dec 4th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.71 KB | None | 0 0
  1.  
  2.         String[] sizeInput = reader.readLine().split(" ");
  3.  
  4.         final int rows = Integer.parseInt(sizeInput[0]);
  5.         final int cols = Integer.parseInt(sizeInput[1]);
  6.  
  7.         int[][] field = new int[rows][];
  8.  
  9.         int currentRow = 0;
  10.         int currentCol = 0;
  11.  
  12.         for (int i = 0; i < field.length; i++) {
  13.             String[] inputRow = reader.readLine().split(" ");
  14.             field[i] = new int[inputRow.length];
  15.             for (int j = 0; j < field[i].length; j++) {
  16.                 field[i][j] = Integer.parseInt(inputRow[j]);
  17.                 if (field[i][j] == 0) {
  18.                     currentRow = i;
  19.                     currentCol = j;
  20.                 }
  21.             }
  22.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement