c++ 当输入的数据不符合数据类型时,清理输入流 if (!cin) { cin.clear(); while (cin.get() != ' ') continue; cout << "Bad input; input process terminated. "; break; }