Input numbers by keyboard into array but only 1 line
<p>Is there any way to enter numbers (seperated by spaces) on a single line into an array ? I mean, I used to write like this:</p>
<blockquote>
<p>First, I entered sizeofarray. Then, I used [for] loop to enter each number into each element. In this method, I had to press enter for each time</p>
</blockquote>
<p>So what I want is:</p>
<blockquote>
<p>First, enter sizeofarray. Then, on a single line, enter all numbers for all elements, each of it seperated by a space</p>
<p>Ex: 7, enter</p>
<p>1 5 35 26 5 69 8, enter</p>
</blockquote>
<p>So that all numbers are stored into elements dedicated.</p>
<p>I know my English is not good and I'm not a good coder. So please explain it easy. Thanks :D</p>