if (!cin) { cin.clear(); while (cin.get() != '\n') continue; cout << "Bad input; input process terminated.\n"; break; }