Advertisement
Spocoman

Cat Watch

Sep 2nd, 2024
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 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 i = 1; i <= n - 2; i++) {
  9.             System.out.printf("%s||%s||%s\n", " ".repeat(n), "_".repeat(n - 2), " ".repeat( n));
  10.         }
  11.  
  12.         System.out.printf("%s//%s\\\\%s\n", " ".repeat(n - 1), " ".repeat( n), " ".repeat(n - 1));
  13.  
  14.         for (int i = 1; i <= n - 4; i++) {
  15.             System.out.printf("%s||%s||%s\n", " ".repeat(n - 2), "_".repeat(n + 2), ((i == (n - 3) / 2) ? "]" : ""));
  16.         }
  17.  
  18.         System.out.printf("%s\\\\%s//%s\n", " ".repeat(n - 1), " ".repeat(n), " ".repeat(n - 1));
  19.  
  20.         for (int i = 1; i <= n - 2; i++) {
  21.             System.out.printf("%s||%s||%s\n", " ".repeat(n), "_".repeat(n - 2), " ".repeat(n));
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement