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.
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
cout << endl;
cout << "Homework (out of 70 pts): " ;
int HW ;
cin >> HW ;
cout << "Midterm (out of 100 pts): " ;
int MT ;
cin >> MT ;
cout << "Final (out of 100 pts): " ;
int F ;
cin >> F ;
cout << endl;
int S;
S = HW + MT + F;
cout << "Score: " << S << endl;
cout << endl;
system("pause");
}