# include "myio.h" int mycin(int min, int max, string p) { int choice{}; while (true) { cout << p; cin >> choice; if (cin.fail()) { cin.clear(); std::cin.ignore(std::numeric_limits::max(), '\n'); cout << "ÄãÊÇ£¿" << endl; system("pause"); system("cls"); Menu(); continue; } else if (choice > max || choice < min) { cout << "ÄãÊÇ£¿" << endl; system("pause"); system("cls"); Menu(); continue; } if (choice >= min && choice <= max) { break; } } return choice; }