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)
- for i := 0; i < n; i++ {
- fmt.Println(strings.Repeat(" ", n - (i + 1)) + "*" + strings.Repeat("-*", i))
- }
- for i := n - 2; i >= 0; i-- {
- fmt.Println(strings.Repeat(" ", n - (i + 1)) + "*" + strings.Repeat("-*", i))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement