2012-10-09 21:02:12 -07:00

22 lines
317 B
Go

package main
import "fmt"
func main() {
var x [5]float64
x[0] = 98
x[1] = 93
x[2] = 77
x[3] = 82
x[4] = 83
var total float64 = 0
for _, value := range x {
total += value
}
fmt.Println(total / float64(len(x)))
}
// todo: comment on maps
// todo: comment on channels