📅  最后修改于: 2022-03-11 14:44:45.552000             🧑  作者: Mango
#include
#include
using namespace std;
main () {
int x, y;
// <-- NO READ HERE!
do {
cout << "Enter a number: ";
if (cin >> x) break;
cin.clear();
cin.ignore(numeric_limits::max(), '\n');
}
while (true);
// same as above, for y ...
}