title: C++ determinable array input in one line
body: <p>I'm pretty new to c++ and can't seem to find correct way to code this. I have array of n digits, my code now:</p>
  
  <pre><code>int main()
  {
      int n,i;
      cin &gt;&gt; n;
      int a[n];
      for (i=1;i&lt;=n;i++)
      {
          cin &gt;&gt; a[i];
      }
      return 0;
  }
  </code></pre>
  
  <p>This way every element of array has to be input in different line, is it possible to put all elements of a array in one line, with space between them.</p>