mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 02:16:48 +08:00
05.0.md
This commit is contained in:
15
eBook/examples/chapter_5/for3.go
Normal file
15
eBook/examples/chapter_5/for3.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var i int = 5
|
||||
|
||||
for {
|
||||
i = i - 1
|
||||
fmt.Printf("The variable i is now: %d\n", i)
|
||||
if i < 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user