➽ Problem:-
https://www.hackerrank.com/challenges/staircase/problem
➽ Solution:-
import
java.util.*;
import
java.io.*;
public class
Solution
{
public static void main(String args[])
{
int N, i, j, k;
Scanner sc = new Scanner(System.in);
N = sc.nextInt();
for(i=1;i<=N;i++)
{
for(j=1;j<=N-i;j++)
{
System.out.print("
");
}
for(k=j;k<=N;k++)
{
System.out.print("#");
}
System.out.print("\n");
}
}
}
0 Comments
Please do not enter any spam link in the comment section.