package main
import (
"fmt"
)
func main() {
map1 := map[int]string{1: "Golang", 2: "Java", 3: "Python", 4: "C"}
for i, v := range map1 {
fmt.Printf("%d:%s\n",i,v)
}
}
这样是不是更简洁呢
import (
"fmt"
)
func main() {
map1 := map[int]string{1: "Golang", 2: "Java", 3: "Python", 4: "C"}
for i, v := range map1 {
fmt.Printf("%d:%s\n",i,v)
}
}
这样是不是更简洁呢
2020-02-21