Advertisement
MilaDimitrovaa

Домашно - знак СТОП

Nov 15th, 2020
741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.62 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class marinovauprajnenie {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner scan = new Scanner(System.in);
  7.    
  8.             // top
  9.                int n = scan.nextInt();
  10.                 int i = 0;
  11.                 while( i < n + 1 ) {
  12.                       System.out.print(".");
  13.                        i++;
  14.                 }    
  15.                     i = 0;
  16.                 while (i < 2 * n + 1) {
  17.                     System.out.print("_");
  18.                         i++;
  19.                 }      
  20.                      i = 0;  
  21.                 while( i < n + 1 ) {
  22.                      System.out.print(".");
  23.                         i++;
  24.                     }
  25.                 System.out.println("");
  26.                
  27.             int LeftDots = n;
  28.             int RightDots = n;     
  29.             int underscore = 2 * n - 1;
  30.            
  31.                 int red = 0;
  32.                 while(red < n) {
  33.                     i = 0;
  34.                  while(i < LeftDots) {
  35.                       System.out.print(".");
  36.                     i++;
  37.                  }
  38.                
  39.                   System.out.print("//");
  40.                    
  41.                   i = 0;
  42.                     while(i < underscore) {
  43.                           System.out.print("_");
  44.                           i++;
  45.                 }
  46.                       System.out.print("\\\\");
  47.                
  48.                    i = 0;
  49.                    while(i < RightDots) {
  50.                        System.out.print(".");
  51.                        i++;
  52.                    }
  53.                    System.out.println();
  54.            
  55.                    RightDots--;
  56.                    LeftDots--;
  57.                    underscore += 2;
  58.                    red++;
  59.                 }
  60.           // STOP
  61.          
  62.                    System.out.print("//");
  63.               i = 0;
  64.               while(i < (underscore - 5) / 2) {
  65.                   System.out.print("_");
  66.                   i++;
  67.               }
  68.          
  69.               System.out.print("STOP!");
  70.              
  71.               i=0;
  72.               while(i < (underscore - 5) / 2) {
  73.                   System.out.print("_");
  74.                 i++;  
  75.               }
  76.                  
  77.               System.out.print("\\\\");
  78.              
  79.               System.out.println();
  80.              
  81.               // bot
  82.                        
  83.             int Leftdots = 0;
  84.             int Rightdots = 0;     
  85.             int Underscore = 4 * n - 1;
  86.            
  87.                 int redove = 0;
  88.                 while(redove < n) {
  89.                     i = 0;
  90.                  while(i < Leftdots) {
  91.                       System.out.print(".");
  92.                     i++;
  93.                  }
  94.                
  95.                   System.out.print("\\\\");
  96.                    
  97.                   i = 0;
  98.                     while(i < Underscore) {
  99.                           System.out.print("_");
  100.                           i++;
  101.                 }
  102.                       System.out.print("//");
  103.                
  104.                  i = 0;
  105.                  while(i < Rightdots) {
  106.                    System.out.print(".");
  107.                    i++;
  108.                  }
  109.                  System.out.println();
  110.          
  111.                  Rightdots++;
  112.                  Leftdots++;
  113.                  Underscore -= 2;
  114.                  redove++;
  115.                 }
  116.          
  117.    
  118.        
  119.  }
  120. }
  121.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement