Browse Source

adding spaces in the output

pull/654/head
MSilva95 4 years ago
parent
commit
99bd92bcb9
  1. 12
      go/tests/prog/range_prog/main.go

12
go/tests/prog/range_prog/main.go

@ -4,8 +4,6 @@ import (
"fmt" "fmt"
"os" "os"
"strconv" "strconv"
"lib"
) )
func main() { func main() {
@ -22,8 +20,14 @@ func main() {
fmt.Println(err) fmt.Println(err)
return return
} }
for _, i := range lib.IntRange(a, b) { fmt.Print(a)
fmt.Print(i, " ") for b != a {
if a < b {
a++
} else {
a--
}
fmt.Print(" ", a)
} }
fmt.Println() fmt.Println()
} }

Loading…
Cancel
Save