Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var num int
- fmt.Scanln(&num)
- var counter = 0
- for row := 0; row < num || counter < num; row++ {
- for col := 0; col < row && counter < num; col++ {
- counter++
- fmt.Printf("%d ", counter)
- }
- fmt.Println()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement