#include #include using namespace std; int main() { double x; if (cin >> x) // check whether input is successful cout << "x = " << x << endl; // input successful else cout << "invalid input" << endl; // input failed }