cout << "Please enter a correct number,like 1,2,3...." << endl;
break;
}
}
else {
cout << "Please enter a correct number,like 1,2,3...." << endl;
}
}
}
voidTestCin() {
int day;
int day0;
while (1) {
if (!(cin >> day)) { //if the input is 2.3, it will enter the correct state first and then enter the fail state, 2 will cast correctly, .3 will enter the false state
if (!(cin >> day0)) { //if the input is 2.3, it will enter the correct state first and then enter the fail state, 2 will cast correctly, .3 will enter the false state