A Tour of Go For

Go has only one looping construct, the for loop.

The basic for loop looks as it does in C or Java, except that the ( ) are gone (they are not even optional) and the { } are required.

package main 

import "fmt"

func main() {
sum :=
for i := ; i < ; i++ {
sum += i
}
fmt.Println(sum)
}
上一篇:STM32 CAN 波特率设置及采样点设置


下一篇:find_if函数与partition函数的转换