You are viewing a single comment's thread. Return to all comments →
This is my solution for java8
public static void staircase(int n) { int s = n-1; int h = 1; while (n != 0) { for (int i = 0; i < s; i++) { System.out.print(" "); } for (int j = 0; j < h; j++) { System.out.print("#"); } System.out.println(); h++; s--; n--; } }
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 →
This is my solution for java8