You are viewing a single comment's thread. Return to all comments →
Java 15
public static void staircase(int n) { int repeat = 1; for(int i=n ; i > 0; i-- ) { System.out.println(" ".repeat(i-1)+"#".repeat(repeat++)); }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Staircase
You are viewing a single comment's thread. Return to all comments →
Java 15
public static void staircase(int n) { int repeat = 1; for(int i=n ; i > 0; i-- ) { System.out.println(" ".repeat(i-1)+"#".repeat(repeat++)); }