Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Main
  4. {
  5. public static void main(String[] args)
  6. {
  7. Scanner kin = new Scanner(System.in);
  8.  
  9. System.out.print("Height: ");
  10. int height = kin.nextInt();
  11.  
  12.  
  13. for(int row = 1; row <= height; row++)
  14. {
  15. for(int space = 1; space <= height-row; space++)
  16. {
  17. System.out.print(" ");
  18. }
  19. for(int hash = 1; hash <= row; hash++)
  20. {
  21. System.out.print("#");
  22. }
  23. System.out.println();
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement