在一行中创建多个数组 [英] Create multiple arrays in one line
本文介绍了在一行中创建多个数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我做到了:
a, b = Array.new(2, [0, 0])
a[0] = 1
我有:
a # => [1, 0]
我遇到b
的问题,这与a
相同:
I have a problem with b
, which is the same as a
:
b # => [1, 0]
问题是参考地址.
帮我在一行中初始化数组.
Help me initialize array in one line.
推荐答案
查看全文