title: Why does scanf() not change line after input?
body: <p>I want to input something like</p>
  
  <pre><code>1
  3
  1 2 3
  4 5 6
  7 8 9
  </code></pre>
  
  <p>But with this code</p>
  
  <pre><code>int main()
  {
      int t;
      scanf("%d", &amp;t);
      while (t--)
      {
          int n;
          scanf("%d", &amp;n);
          vector &lt;int&gt; k, a, s;
          for (int i = 0; i &lt; n; ++i)
          {
              scanf("%d", &amp;k[i]);
          }
          for (int i = 0; i &lt; n; ++i)
          {
              scanf("%d", &amp;a[i]);
          }
          for (int i = 0; i &lt; n; ++i)
          {
              scanf("%d", &amp;s[i]);
          }
          for (int i = 0; i &lt; n; ++i)
          {
              printf("%d %d %d", (int)k[i], (int)a[i], (int)s[i]);
          }
      }
  }
  </code></pre>
  
  <p>I can only input </p>
  
  <pre><code>1
  3
  1 2 3
  </code></pre>
  
  <p>scanf() does not change lines after the first for loop. How do I take in all the input?</p>