Advertisement
Guest User

Untitled

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