Advertisement
Spocoman

Eiffel Tower

Sep 5th, 2024 (edited)
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.14 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; row++) {
  9.             System.out.println("-".repeat(n + 2) + "**" + "-".repeat(n + 2));
  10.         }
  11.         for (int row = 0; row < n - 3; row++) {
  12.             System.out.println("-".repeat(n + 1) + "****" + "-".repeat(n + 1));
  13.         }
  14.         System.out.println("-".repeat(n) + "******" + "-".repeat(n));
  15.  
  16.         for (int row = 0; row < n - 4; row++) {
  17.             System.out.println("-".repeat(n) + "**--**" + "-".repeat(n));
  18.         }
  19.         for (int row = 0; row < n - 3; row++) {
  20.             System.out.println("-".repeat(n - 1) + "**----**" + "-".repeat(n - 1));
  21.         }
  22.         System.out.println("-".repeat(n - 2) + "*".repeat(10) + "-".repeat(n - 2));
  23.  
  24.         for (int row = n - 3; row > 0; row--) {
  25.             System.out.println("-".repeat(row) + "**" + "-".repeat(2 * n + 2 - 2 * row) + "**" + "-".repeat(row));
  26.         }
  27.         System.out.println("***" + "-".repeat(2 * n) + "***");
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement