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