public static void main(String[] args) {
System.out.println("pattern 10 ");
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int rows=1;
int nst =2*n-1;
while(rows<=n)
{
//work for spaces
for(int csp=1;csp<2*rows-1;csp++)
{
System.out.print(" ");
}
//work for stars
for(int cst = 1; cst<=nst;cst++)
{
System.out.print("*");
}
//preparation
System.out.println();
rows++;
}
// public static void main(String[] args) {
System.out.println("pattern 10 ");
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int rows=1;
int nst =2*n-1;
while(rows<=n)
{
//work for spaces
for(int csp=1;csp<2*rows-1;csp++)
{
System.out.print(" ");
}
//work for stars
for(int cst = 1; cst<=nst;cst++)
{
System.out.print("*");
}
//preparation
System.out.println();
rows++;
}
// public static void main(String[] args) {
System.out.println("pattern 10 ");
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int rows=1;
int nst =2*n-1;
while(rows<=n)
{
//work for spaces
for(int csp=1;csp<2*rows-1;csp++)
{
System.out.print(" ");
}
//work for stars
for(int cst = 1; cst<=nst;cst++)
{
System.out.print("*");
}
//preparation
System.out.println();
rows++;
}
reverse pyramid unable to print