Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "strings"
- )
- func main() {
- var n, x int
- fmt.Scanln(&n)
- if n > 4 {
- x = n * 2 - (n / 2 + 2) * 2
- }
- fmt.Printf("/%s\\%s/%s\\\n", strings.Repeat("^", n / 2), strings.Repeat("_", x), strings.Repeat("^", n / 2))
- for i := 0; i < n - 3; i++ {
- fmt.Printf("|%s|\n", strings.Repeat(" ", n * 2 - 2))
- }
- fmt.Printf("|%s%s%s|\n", strings.Repeat(" ", (n * 2 - (x + 2)) / 2), strings.Repeat("_", x), strings.Repeat(" ", (n * 2 - (x + 2)) / 2))
- fmt.Printf("\\%s/%s\\%s/\n", strings.Repeat("_", n / 2), strings.Repeat(" ", x), strings.Repeat("_", n / 2))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement