Advertisement
MilaDimitrovaa

Фигурка без метод

Oct 21st, 2020
1,022
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1. public static void main(String[] args) {
  2.         Scanner scan = new Scanner(System.in);
  3.  
  4.         int n = scan.nextInt();
  5.         int score = 0;
  6.         if (n > 4) {
  7.             score = 4;
  8.         }
  9.         System.out.print("/");
  10.         for( int i = 0 ; i < n / 2 ; i++ ) {
  11.         System.out.print("*");
  12.     }
  13.        System.out.print("\\") ;
  14.        
  15.        for( int i = 0 ; i < score / 2 ; i++) {
  16.            System.out.println("_");
  17.        }
  18.       System.out.print("/");
  19.        for( int i = 0 ; i < n / 2 ; i++ ) {
  20.        System.out.print("*");
  21.    }
  22.       System.out.print("\\") ;
  23.       System.out.println();
  24.        
  25.      
  26.       for (int i  = 0 ; i < n - 3 ; i++) {
  27.            System.out.print("|");
  28.          for ( int j = 0 ; j < n * 2 - 2 ; j++) {
  29.              System.out.print(" ");
  30.          }
  31.            System.out.print("|");
  32.            System.out.println();
  33.        }
  34.        
  35.        
  36.        
  37.        System.out.print("\\");
  38.        for( int i = 0 ;i < n / 2 ; i++ ) {
  39.        System.out.print("-");
  40.    }
  41.      System.out.print("/");
  42.      for( int i = 0 ; i < score / 2 ; i++) {
  43.        System.out.println("_");
  44.      }
  45.      System.out.print("\\");
  46.      for( int i = 0 ;i < n / 2 ; i++ ) {
  47.      System.out.print("-");
  48.  }
  49.    System.out.print("/");
  50.        
  51.        
  52.     }
  53.  
  54. }
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement