fork 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. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. int l, c, num = 0;
  13. int [][]m;
  14. m = new int[4][3];
  15. for (c = 0; c < 3; c++){
  16. for (l = 0; l < 4; l++){
  17. m[l][c] = num;
  18. num++;
  19. }
  20. }
  21. for (l = 0; l < 4; l++){
  22. for (c = 0; c < 3; c++){
  23. System.out.println(m[l][c]);
  24. }
  25. }
  26. }
  27. }
Success #stdin #stdout 0.04s 320576KB
stdin
Standard input is empty
stdout
0
4
8
1
5
9
2
6
10
3
7
11