标签:golang
已知 x:= []int{1, 2, 3, 4, 5, 6}实现如下:
package main
import (
"fmt"
)
func main() {
x := []int{1, 2, 3, 4, 5, 6}
for i := range a {
if i < len(a)-2 {
fmt.Println(a[i], a[i+1], a[i+2])
}
}
}
标签:golang
原文地址:http://blog.51cto.com/13187574/2083960