You are viewing a single comment's thread. Return to all comments →
JAVA CODE: ` public static void staircase(int n) {
int padding = 0; int elem = 0; for(int i = 1; i <= n; i++) { padding = n - i; elem = n - padding; if(padding > 0) System.out.format("%" + padding + "s", ""); do { System.out.print("#"); elem--; } while(elem > 0); System.out.println(); } }
`
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 CODE: ` public static void staircase(int n) {
`