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(); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter