#include #include //Introducing two more members of namespace std, cin and cerr. //And another possible exit status number, EXIT_FAILURE. // //The if (!std::cin) means "if std::cin is in an unhealthy state as a result //of a failure of the previous attempt at input". int main() { int price {0}; //This variable will die whenever we return. std::cout << "Please type the price and press RETURN.\n"; std::cin >> price; if (!std::cin) { std::cerr << "Sorry, that wasn't an acceptable number.\n"; return EXIT_FAILURE; } std::cout << "The variable contains " << price << ".\n"; return EXIT_SUCCESS; }