Advertisement
MilaDimitrovaa

Фигурка

Oct 14th, 2020
800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class gugugug {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner scan = new Scanner(System.in);
  7.        
  8.         int n = scan.nextInt();
  9.         System.out.print("+");
  10.         for( int i = 0 ; i < n - 2 ; i++ ) {
  11.         System.out.print("-");
  12.     }
  13.        System.out.println("+");
  14.        
  15.        for (int i  = 0 ; i < n - 2 ; i++) {
  16.            System.out.print("|");
  17.          for ( int j = 0 ; j < n - 2 ; j++) {
  18.              System.out.print("-");
  19.          }
  20.            System.out.println("|");
  21.        }
  22.        
  23.        System.out.print("+");
  24.         for( int i = 0 ; i < n - 2 ; i++ ) {
  25.         System.out.print("-");
  26.     }
  27.       System.out.println("+");
  28.        
  29.        
  30.        
  31.        
  32.        
  33.        
  34.        
  35.     }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement