rectangle_stars.go 402 B

123456789101112131415161718192021222324252627
  1. // rectangle_stars.go
  2. package main
  3. import "fmt"
  4. func main() {
  5. w, h := 20, 10
  6. for y := 0; y < h; y++ {
  7. for x := 0; x < w; x++ {
  8. fmt.Print("*")
  9. }
  10. fmt.Println()
  11. }
  12. }
  13. /* Output:
  14. ********************
  15. ********************
  16. ********************
  17. ********************
  18. ********************
  19. ********************
  20. ********************
  21. ********************
  22. ********************
  23. ********************
  24. */