[Go] Array

package main

import (
	"fmt"
)

func main() {
	//var scores [5]float64
	//fmt.Println(scores) // [0.0, 0.0,0.0,0.0,0.0]

	//var scores [5]float64 = [5]float64{9, 1.5, 4.5, 7, 8}
	//scores := [5]float64{9, 1.5, 4.5, 7, 8}
	scores := [...]float64{9, 1.5, 4.5, 7, 8}
	fmt.Println(scores) //[9, 1.5, 4.5, 7, 8]
}

 

posted @ 2022-09-04 20:13  Zhentiw  阅读(10)  评论(0编辑  收藏  举报