try{
int codeid=input.nextInt();
switch(codeid){
case 1:
inbook(user);
break;
case 3:
doStoreMgr(user);
break;
default:
throw new Exception();
}
}
catch(Exception e)
{ System.out.println("请选择正确的数字");
input.nextLine();//加上这句之后就不会死循环了
doStoreMgr(user);
}
能具体讲讲吗?