Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var n int
- fmt.Scanln(&n)
- for i := 1; i <= (n + 1) / 2; i++ {
- for j := 0; j < (n + 1) / 2 - i; j++ {
- fmt.Print("-")
- }
- if n % 2 == 1 {
- fmt.Print("*")
- } else {
- fmt.Print("**");
- }
- for k := 1; k < i; k++ {
- fmt.Print("**")
- }
- for j := 0; j < (n + 1) / 2 - i; j++ {
- fmt.Print("-")
- }
- fmt.Println()
- }
- for i := 0; i < n / 2; i++ {
- fmt.Print("|")
- for x := 0; x < n - 2; x++ {
- fmt.Print("*")
- }
- fmt.Println("|")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement