snippet for 2d array input

PHOTO EMBED

Mon Jul 26 2021 06:08:27 GMT+0000 (UTC)

Saved by @aurobind #java

  Scanner scn = new Scanner(System.in);
    int n = scn.nextInt();
    int m = scn.nextInt();
    
    int [][]arr = new int[n][m];
    
    for(int i=0;i<arr.length;i++){
        for(int j=0;j<arr[0].length;j++){
            one [i][j] = scn.nextInt();
        }
    }
content_copyCOPY