新手求教一个关于slice的问题

wumier · 2017-11-02 13:36:04 · 1820 次点击

应该输出的结果就是我截的第一张图。我现在的问题是每次stack都找的对,但是append之后,result已有的数据就全变了

#4
更多评论

试试 result = append(result, []int{stack})

#1

报错了额。。。cannot use stack (type []int) as type int in array or slice literal

#2