Dimitar_Iliev

Untitled

Dec 5th, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import javax.swing.*;
  2. import java.util.Scanner;
  3.  
  4. public class App1 {
  5. public static void main(String[] args) {
  6. Scanner scan = new Scanner(System.in);
  7. int n = scan.nextInt();
  8. // top
  9. System.out.print("+");
  10. for (int i = 0; i < n - 2; i++) {
  11. System.out.print("-");
  12. }
  13. System.out.print("+");
  14. System.out.println();
  15.  
  16. //midd
  17. for (int i = 0; i < n - 2 ; i++) {
  18. System.out.print("|");
  19. for (int i2 = 0; i2 < n - 2 ; i2++) {
  20. System.out.print("-");
  21. }
  22. System.out.print("|");
  23. System.out.println();
  24. }
  25.  
  26. //bot
  27. System.out.print("+");
  28. for (int i = 0; i < n - 2; i++) {
  29. System.out.print("-");
  30. }
  31. System.out.print("+");
  32. }
  33. }
Add Comment
Please, Sign In to add comment