Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. import java.util.Random;
  7. import java.util.Scanner;
  8. import java.util.Arrays;
  9.  
  10. /**
  11. *
  12. * @author ja
  13. */
  14. public class Main {
  15.  
  16. char[][] zadanie5(int ilosc) {
  17. char[][] tab = new char[ilosc][ilosc];
  18. for (int i = 0; i < tab.length; i++) {
  19. System.out.println();
  20. for (int j = 0; j < tab.length; j++) {
  21. if ((i == j) || (i > j)) {
  22. tab[i][j] = '*';
  23. }
  24. System.out.print(tab[i][j] + " ");
  25. }
  26.  
  27. }
  28. return tab;
  29. }
  30.  
  31. /**
  32. * @param args the command line arguments
  33. */
  34. public static void main(String[] args) {
  35. Main a = new Main();
  36. a.zadanie5(10);
  37.  
  38. }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement