运行一下下面的代码, 猜一猜结果会是什么?
func test03() {
number03 := []int {1, 2, 3, 4, 5, 6}
maxlen := len(number03) - 1
for i, e := range number03 {
if i == maxlen {
number03[0] += e
} else {
number03[i + 1] += e
}
}
fmt.Print(number03);
}
标签:思考,number03,切片,maxlen,range,func
From: https://www.cnblogs.com/zhengel/p/17041880.html