updated readme
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// Author: Rodney Shaghoulian
|
||||
// Github: github.com/rshaghoulian
|
||||
// HackerRank: hackerrank.com/rshaghoulian
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Solution {
|
||||
public static void main(String [] args) {
|
||||
/* Save input */
|
||||
Scanner scan = new Scanner(System.in);
|
||||
int n = scan.nextInt();
|
||||
scan.close();
|
||||
|
||||
/* Print staircase */
|
||||
for (int spaces = n - 1; spaces >= 0; spaces--) {
|
||||
for (int i = 0; i < spaces; i++) {
|
||||
System.out.print(" ");
|
||||
}
|
||||
for (int i = spaces; i < n; i++) {
|
||||
System.out.print("#");
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user