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