Advertisement
Guest User

Eryk pomusz

a guest
Nov 21st, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1.  public static char[][] znakiwielo(int m, int n){
  2.       char [][] tabwielo;
  3.       tabwielo = new char [m][n];
  4.       char min = 'a';
  5.       char max = 'z';
  6.       for(int i = 0;i<m;i++){
  7.         for(int j = 0;j<n;j++){
  8.         tabwielo[i][j] =(char) ((Math.random() * (max - min)) + min);
  9.         }
  10.       }
  11.       return (tabwielo);
  12.     }
  13.  
  14.     public static void printwielo(char [][] b){
  15.       for(int i = 0;i<b.length;i++){
  16.       for(int j = 0; i<b[i].length-1;j++){
  17.       System.out.print(b[i][j] + " ");
  18.       }
  19.     }
  20.   }
  21.  
  22.     public static void main(String[] args) {
  23. char [][] wynikwielo;
  24. wynikwielo = znakiwielo(6, 4);
  25. printwielo(wynikwielo);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement