title: How to take multiple arrays as input in C++?
body: <p>I started learning C++ a week ago, coming from C.</p>
  
  <p>The input I have is of the following format:</p>
  
  <pre><code>7
  13 -4 -10 4 9 7 -3
  4
  0 -2 -1 2
  2
  3 5
  0
  </code></pre>
  
  <p>The first number gives the number of elements in the first array. We stop scanning arrays once this number is a zero.</p>
  
  <p>I would like to scan these arrays into an array of arrays as follows:</p>
  
  <pre><code>[[13,-4,-10,4,9,7,-3] , [0,-2,-1,2] , [3,5]]
  </code></pre>
  
  <p>I know how to scan in the first array:</p>
  
  <pre><code>int n;
  int array1[MAXLENGTH];
  cin &gt;&gt; n;
  for (int i = 0; i &lt; n; i++) {
      cin &gt;&gt; array1[i];
      // scanf("%d", &amp;array1[i]);
  }
  </code></pre>
  
  <p>I get stuck on <code>0 -2 -1 2</code> since it starts with zero.</p>
  
  <p>How can I scan in these arrays and stop once I encounter the last zero?</p>