title: How to read n integers from standard input in C++?
body: <p>I need to read something like:</p>
  
  <pre><code>5 60 35 42
  2 38 6
  5 8
  300 1500 900
  </code></pre>
  
  <p>And then save the first line in an array. After calling other functions do the same with the next line, and so on.</p>
  
  <p>I try with <code>gets()</code> and then use <code>sscanf()</code> to scan the integers from the string, but I don't know how to read n numbers from a string.</p>