Petra_Abrasheva_185

Theme_6.1_stop

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