Guest User

Untitled

a guest
Jul 26th, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. package Matrix;
  2.  
  3. import java.util.*;
  4. public class Matrix
  5. {
  6.  
  7. public static void main(String[] args)
  8. {
  9. Scanner in = new Scanner(System.in);
  10. System.out.print("x...y\n");
  11. int x = in.nextInt();
  12. int y = in.nextInt();
  13. int z = in.nextInt();
  14. int c = in.nextInt();
  15. int[][] MatrixA = new int[x][y];
  16. Random r = new Random(System.currentTimeMillis());
  17. for(int i = 0; i < x; i++)
  18. {
  19. for(int b = 0; b < y; b++){
  20. MatrixA[i][b] = r.nextInt(c-z+1)+z;
  21. System.out.printf("%4d", MatrixA[i][b]);
  22.  
  23. }System.out.println();
  24.  
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment