Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Recursion {
  4.  
  5. public static void main(String[] args) {
  6. Scanner sc = new Scanner(System.in);
  7. draw(sc.nextInt());
  8. sc.close();
  9.  
  10. }
  11.  
  12. public static void draw(int h) {
  13. if(h == 0) {
  14. return;
  15. }
  16. draw(h-1);
  17.  
  18. for(int i = 0; i < h; i++) {
  19. System.out.printf("#");
  20. }
  21. System.out.printf("\n");
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement