2022-07-06 14:06:57 +08:00
|
|
|
|
/*
|
|
|
|
|
* 菜单工具接口实现
|
|
|
|
|
*/
|
2022-07-04 00:31:52 +08:00
|
|
|
|
#include"MenuUtils.h"
|
|
|
|
|
|
|
|
|
|
void checkOptInput(int& opt, int low, int high) {
|
2022-07-06 14:06:57 +08:00
|
|
|
|
printf(">>>请输入选项(%d-%d):", low, high);
|
2022-07-04 00:31:52 +08:00
|
|
|
|
while (!(cin >> opt) || (opt < low) || (opt > high)) {
|
2022-07-06 14:06:57 +08:00
|
|
|
|
cout << "输入选项错误!请重新输入:";
|
2022-07-04 00:31:52 +08:00
|
|
|
|
cin.clear();
|
|
|
|
|
while (cin.get() != '\n');
|
|
|
|
|
}
|
2022-07-06 14:06:57 +08:00
|
|
|
|
}
|