Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Recursion {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- draw(sc.nextInt());
- sc.close();
- }
- public static void draw(int h) {
- if(h == 0) {
- return;
- }
- draw(h-1);
- for(int i = 0; i < h; i++) {
- System.out.printf("#");
- }
- System.out.printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement