package main
import "fmt"
func main() {
total := 0
i_total := 0
for i := 0; i < 10; i++ {
total += 1
i_total += i
}
fmt.Println(total)
fmt.Println(i_total)
}
输出:
10 45
(adsbygoogle = window.adsbygoogle || []).push({});
来源:https://www.02405.com/archives/8104