package main
import (
"fmt"
)
func main(){
twoD := make([][]int, 3)
for i := 0; i<3; i++ {
innerlen := i+1
twoD[i] = make([]int, innerlen)
for j := 0; j< innerlen; j++{
twoD[i][j] = i+j
}
}
fmt.Println(twoD)
}
网友评论