Advertisement
Spocoman

Skyscraper

Oct 13th, 2024
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 1.11 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.   "fmt"
  5.   "strings"
  6. )
  7.  
  8. func main() {
  9.     var n int
  10.     fmt.Scanln(&n)
  11.    
  12.     for row := 0; row < n - 3; row++ {
  13.         fmt.Println(strings.Repeat(" ", n) + "|" + strings.Repeat(" ", n))
  14.     }
  15.  
  16.     fmt.Println(strings.Repeat(" ", n - 1) + "_|_" + strings.Repeat(" ", n - 1))
  17.  
  18.     for row := 0; row < n - 3; row++ {
  19.         fmt.Println(strings.Repeat(" ", n - 1) + "|-|" + strings.Repeat(" ", n - 1))
  20.     }
  21.  
  22.     fmt.Println(strings.Repeat(" ", n - 2) + "_|-|_" + strings.Repeat(" ", n - 2))
  23.  
  24.     for row := 0; row < n - 3; row++ {
  25.         fmt.Println(strings.Repeat(" ", n - 2) + "|***|" + strings.Repeat(" ", n - 2))
  26.     }
  27.  
  28.     fmt.Println(" " + strings.Repeat("_", n - 3) + "|***|" + strings.Repeat("_", n - 3) + " ");
  29.  
  30.     for row := 0; row < n * 4 - 1; row++ {
  31.         fmt.Println(" " + strings.Repeat("|", n - 2) + "---" + strings.Repeat("|", n - 2) + " ")
  32.     }
  33.  
  34.     fmt.Println("_" + strings.Repeat("|", n - 2) + "---" + strings.Repeat("|", n - 2) + "_")
  35.  
  36.     for row := 0; row < n - 2; row++ {
  37.         fmt.Println(strings.Repeat("|", n * 2 + 1))
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement