a := [...]int{5, 4: 1, 0, 2: 3, 2, 1: 4 }
fmt.Println(a)
结果是 [5 4 3 2 1 0]。怎么排序?
a := [...]int{5, 4: 1, 0, 2: 3, 2, 1: 4 ,12,11,10}
fmt.Println(a)
结果是
prog.go:8: duplicate index in array literal: 2
prog.go:8: duplicate index in array literal: 3
prog.go:8: duplicate index in array literal: 4
[process exited with non-zero status]
谁能解释这两个结果?
紫衣仙女
白衣染霜花
相关分类