1
0
mirror of https://github.com/MADTeacher/go_basics.git synced 2025-11-29 05:36:55 +02:00
Files
go_basics/part_1/1.11/11.go

25 lines
252 B
Go
Raw Normal View History

package main
import "fmt"
func main() {
for i := 0; i < 5; i++ {
fmt.Printf("%d ", i)
}
fmt.Println()
// или
for i := range 5 {
fmt.Printf("%d ", i)
}
fmt.Println()
// или
i := 0
for range 5 {
fmt.Printf("%d ", i)
i++
}
}