Go数组求和时间:2023-03-08 15:16:13 package main import "fmt" var a []int func main() { a := []int{,,,,} var b int for index,value := range a{ fmt.Println(index,value) b += value } fmt.Println(b) }