gobyexample/014-floats.go
2012-09-20 22:09:22 -07:00

13 lines
174 B
Go

package main
import "fmt"
func main() {
x := [5]float64{ 98, 93, 77, 82, 83 }
total := 0.0
for _, v := range x {
total += v
}
fmt.Println(total / float64(len(x)))
}