我如何使用for循环将数组1添加到数组2并成为预期的数组,如下例所示?
因此,我期望的是将数组1中的第一个元素添加到数组2的第二个1234中,然后继续累加。
Array 1 = [4, 8]
Array 2 = [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
预期数组:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
我在想这样的事情,但是感觉很奇怪。
N=4
for (int i=N; i<array.size; i++)
{
array2[i] = array1[...];
}
您上面描述的问题不清楚。
In your description, the arry1 only use the first item, then why we need it?
How do the
N = 4
comes from?