How to repeat scanf() n times?
<p>I ask the user to input two integers, <strong>n</strong> and <strong>x</strong>. After that, I need to ask them for a value for the <strong>a</strong> variable <code>n</code> times. I need to create a new a variable for each value. How do I do it? I have absolutely no idea.</p>

<p>Also, I need to do it in one line, so the input will be, for example, <code>50 30 21</code>, not</p>

<pre><code>50
30
21
</code></pre>

<p>Thanks.</p>

<pre><code>#include &lt;stdio.h&gt;

int main (void) {
  int a, n, x;
  int i = 0;

  scanf ("%d%d", &amp;n, &amp;x);

  scanf ("%d", &amp;a); /* what should I do here? */
}
</code></pre>