Hollow Pyramid

 import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int input=sc.nextInt();
        int i,j,k;
         for(i=1;i<=input;i++)
        {
            for(j=i;j<input;j++)
            {
                System.out.print("b");
            
            }
            for(j=1;j<=(2*i)-1 ; j++)
            {
                if(j==1 || i==input || j==((2*i)-1) )
                {
                    System.out.print("*");
                }
                else{System.out.print("i");}
            }
            for(k=; k<input;k++)
            {System.out.print("b");}
            System.out.print("\n");
        }
        
            // Fill your code here
        
     }
}

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.