Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Main
- {
- public static void main(String[] args)
- {
- Scanner kin = new Scanner(System.in);
- System.out.print("Height: ");
- int height = kin.nextInt();
- for(int row = 1; row <= height; row++)
- {
- for(int space = 1; space <= height-row; space++)
- {
- System.out.print(" ");
- }
- for(int hash = 1; hash <= row; hash++)
- {
- System.out.print("#");
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement