title: C++: how to input values separated by comma(,)
body: <pre><code>int a, b, c, d;
  </code></pre>
  <p>There are 4 variables.</p>
  <p>I want user to input 4 values, and each value is separated by comma(,)</p>
  <p>Just like this:</p>
  <blockquote>
  <p><strong>stdin:</strong></p>
  <p>1,2,3,4</p>
  </blockquote>
  <p>The following code works in C</p>
  <pre><code>scanf(&quot;%d,%d,%d,%d&quot;, &amp;a, &amp;b, &amp;c, &amp;d);
  </code></pre>
  <p>But how should I code in C++?</p>