fork download
  1. class Main{
  2.  
  3. public static void main(String[] args)
  4. {
  5. int n=3;
  6. for(int i=0;i<n;i++)
  7. {
  8. for(int j=0;j<n+4;j++)
  9. {
  10. if(i==0 || j==(n+3) ){
  11. System.out.print("*");
  12. }
  13. else
  14. {
  15. System.out.print(" ");
  16. }
  17.  
  18. }
  19. System.out.println();
  20. }
  21.  
  22. }
  23. }
  24.  
Success #stdin #stdout 0.09s 52584KB
stdin
5
stdout
*******
      *
      *