#include #include using namespace std; int main() { short i{-999}; string restOfLine; cout << "Starting out, i = " << i << endl; cout << "Enter an integer => "; cin >> i; cout << endl; if (cin) { cout << "The input was successful!" << endl; getline(cin, restOfLine); } else { cout << "The input was NOT successful." << endl; cin.clear(); getline(cin, restOfLine); } cout << "i = " << i << endl; cout << "Rest of line = \"" << restOfLine << "\"" << endl; return 0; }