title: How to read input numbers separated with spaces from command line c++
body: <p>I'v got below code:</p>
  
  <pre><code>    std::cin &gt;&gt; N &gt;&gt; T;
      std::vector&lt;int&gt; width;
  
      for (int w = 0; w &lt; N; w++)
      {
          int tmp;
          std::cin &gt;&gt; tmp;
  
          width.push_back(tmp);
      }
  </code></pre>
  
  <p>If I put <code>3 2 3 4</code> as inputs in console, it separates by white space and stores as a vector array.</p>
  
  <p>My question is how is it able to read integer values in <code>cin</code> separated by spaces? I would have thought you should be doing <code>std::cin &gt;&gt; tmp</code> input four times?</p>