Section9-ex2
This commit is contained in:
30
Section8/74.go
Normal file
30
Section8/74.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
grades := [3]int{
|
||||
1: 30,
|
||||
0: 5,
|
||||
2: 7,
|
||||
}
|
||||
fmt.Println(grades)
|
||||
|
||||
accounts := [3]int{2: 50}
|
||||
fmt.Println(accounts)
|
||||
|
||||
names := [...]string{
|
||||
5: "Dan",
|
||||
}
|
||||
fmt.Println(names, len(names))
|
||||
|
||||
cities := [...]string{
|
||||
5: "Paris",
|
||||
"London", //index 6
|
||||
1: "NYC",
|
||||
}
|
||||
fmt.Printf("%#v\n", cities)
|
||||
|
||||
weekend := [7]bool{5: true, 6: true}
|
||||
fmt.Println(weekend)
|
||||
}
|
||||
Reference in New Issue
Block a user