Advertisement
Spocoman

06. Rhombus of Stars

Sep 25th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.36 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.     "strings"
  6. )
  7.  
  8. func main() {
  9.     var n int
  10.     fmt.Scanln(&n)
  11.    
  12.     for row := 1; row <= n; row++ {
  13.         fmt.Println(strings.Repeat(" ", n - row) + strings.Repeat("* ", row))
  14.     }
  15.     for row := n - 1; row > 0; row-- {
  16.         fmt.Println(strings.Repeat(" ", n - row) + strings.Repeat("* ", row))
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement