Weird outputs with simple Arithmetic C++
<p>If I give this program a string as in input it gives me some very strange outputs. How do I go about handling this? I'd like it to simply state that there was an error on the consul. </p>

<pre><code>#include &lt;cstdlib&gt; 
#include &lt;iostream&gt;

using namespace std;

int main() 

{ 
    cout &lt;&lt; endl;
    cout &lt;&lt; "Homework (out of 70 pts):  " ;
    int HW ;
    cin &gt;&gt; HW ;

    cout &lt;&lt; "Midterm (out of 100 pts):  " ;
    int MT ;
    cin &gt;&gt; MT ;

    cout &lt;&lt; "Final (out of 100 pts):    " ;
    int F ;
    cin &gt;&gt; F ;
    cout &lt;&lt; endl;

    int S;
    S = HW + MT + F;



    cout &lt;&lt; "Score:     " &lt;&lt; S &lt;&lt; endl;
    cout &lt;&lt; endl; 

    system("pause");
}
</code></pre>
