How to prevent failure of multiple cin statements if one fails : <p>If we have multiple cin statements and one of them gets a wrong input, every following cin fails. How to prevent that?</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

int main() {
    int a, b, c, d, e;
    cin&gt;&gt;a;
    cin&gt;&gt;b;
    cin&gt;&gt;c;
    cin&gt;&gt;d;
    cin&gt;&gt;e;
    return 0;
}
</code></pre>

<p>If I enter some string for first or any other variable that expects int, every cin that follows terminates. How to prevent this failure?</p>
