fork(1) 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 m = 2;
  13. int n = 3;
  14. double[][] x = new double[m][n];
  15.  
  16. double k=1.0;
  17. for(int i=0;i<m;i++)
  18. for(int j=0;j<n;j++)
  19. x[i][j] = k++;
  20.  
  21. for(int i=0;i<m;i++){
  22. for(int j=0;j<n;j++)
  23. System.out.print(x[i][j] + " ");
  24. System.out.println();
  25. }
  26. }
  27. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
1.0 2.0 3.0 
4.0 5.0 6.0