Advertisement
Dimitar_Iliev

Untitled

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