title: Not able to read input till newline
body: <pre><code>    for(int i=0;i&lt;n;i++){
          j=0;
          while(j &lt; 100 &amp;&amp; (scanf("%d%1[^\n]s", &amp;b[j]) == 1)){
              a[b[j]]++;
              j++;
          }
          cout&lt;&lt;j&lt;&lt;endl;
      }
  </code></pre>
  
  <p>Not able to input values till new line.
  I want to count the number of values in a particular line and then input the value of j,
  Please help.</p>