You are viewing a single comment's thread. Return to all comments →
This is mine:
public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); for(int i = 1; i <= n; i++){ String padded = ""; padded = String.format("%-" + i + "s","#").replace(' ','#'); padded = String.format("%" + (n) + "s",padded); System.out.println(padded); } }
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 mine: