fork(2) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. static final int n =3;
  11.  
  12. public static void main (String[] args){
  13.  
  14. Scanner sc = new Scanner(System.in);
  15.  
  16. int A[][] = new int [n][n];
  17.  
  18. int i,j;
  19.  
  20. for (i=0; i < n; i++){
  21. for (j=0; j < n; j++){
  22. A[i][j] = sc.nextInt();
  23. }
  24. }
  25.  
  26. for(int x = 0; x < n; x++){
  27. for(int y=0; y < n; y++){
  28. System.out.print(A[x][y] + " ");
  29. }
  30. System.out.println();
  31. }
  32. }
  33. }
Success #stdin #stdout 0.06s 711680KB
stdin
1 2 3 4 5 6 7 8 9
stdout
1 2 3 
4 5 6 
7 8 9