igrilkul

square frame

Nov 13th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Intro
  3. {
  4. public static void main(String[] Args)
  5. {
  6. Scanner z=new Scanner(System.in);
  7. int n=Integer.parseInt(z.nextLine());
  8. System.out.print("+");
  9. for(int i=1;i<=n-2;i++)
  10. {
  11. System.out.print(" -");
  12. }
  13. System.out.println(" +");
  14. for(int a=1;a<=n-1;a++)
  15. {
  16. System.out.print("|");
  17. for(int b=1;b<=n-2;b++)
  18. System.out.print(" -");
  19. System.out.println(" |");
  20. }
  21. System.out.print("+");
  22. for(int i=1;i<=n-2;i++)
  23. {
  24. System.out.print(" -");
  25. }
  26. System.out.print(" +");
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment