Advertisement
Spocoman

Skyscraper

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