cesarnascimento

triangulo 2

Jun 3rd, 2017
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. public class Main {
  2.     public static void main(String[] args) {
  3.         for(int i=0; i<5; i++){
  4.             for(int j=0; j<5; j++){
  5.                 if(i==j || j==0 || i==4) System.out.print("*");
  6.                 else System.out.print(" ");
  7.             }
  8.             System.out.println();
  9.         }
  10.     }
  11. }
  12. /*
  13.  i\j| 0 | 1 | 2 | 3 | 4 |
  14.  0  |   |   |   |   |   |
  15. ----+---+---+---+---+---|
  16.  1  |   |   |   |   |   |
  17. ----+---+---+---+---+---|
  18.  2  |   |   |   |   |   |
  19. ----+---+---+---+---+---|
  20.  3  |   |   |   |   |   |
  21. ----+---+---+---+---+---|
  22.  4  |   |   |   |   |   |
  23. ----+---+---+---+---+---|
  24. */
Advertisement
Add Comment
Please, Sign In to add comment