You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
375 B
27 lines
375 B
3 years ago
|
package main
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
func main() {
|
||
|
var a1 [3]bool
|
||
|
|
||
|
var a2 = [...]int{1, 2, 3}
|
||
|
fmt.Printf("a1: %T\n", a1)
|
||
|
fmt.Println(a2)
|
||
|
|
||
|
a3 := [...]int{1: 1, 4: 2}
|
||
|
fmt.Println(a3)
|
||
|
|
||
|
a := [3][2]string{
|
||
|
{"北京", "上海"},
|
||
|
{"广州", "深圳"},
|
||
|
{"成都", "重庆"},
|
||
|
}
|
||
|
for _, v1 := range a {
|
||
|
for _, v2 := range v1 {
|
||
|
fmt.Printf("%s\t", v2)
|
||
|
}
|
||
|
fmt.Println()
|
||
|
}
|
||
|
}
|