//写一个工具类,进行输入选项数值的获取
public class InputUtil {
static Scanner sc=new Scanner(System.in);
public static int InputIntTest(){
int num=0;
//此处进行输入的异常捕获
while (true) {
try {
num = sc.nextInt();
break;
} catch (Exception e) {
System.out.println("格式不对,重新输入");
sc.next();
}
}
return num;
}
}