You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB

#include <iostream>
#include "MangerBook.h"
using namespace std;
int main()
{
MangerBook gm;// 实例化管理员
int select;//用户选择
while (true)
{
gm.ShowMenu();
cout << "请选择要执行的操作" << endl;
while (true)
{
cin >> select;
if (!cin) {
cout << "ERROR!" << endl;
cin.clear();
select = 1024;
cin.get();
}
if (select >= EXIT || select <= OTHERS) {
break;
}
else {
cout << "指令非法,请重新输入!" << endl;
system("system");
gm.ShowMenu();
cout << "请选择要执行的操作" << endl;
}
}
switch (select)
{
case EXIT: gm.Exit_Sys(); break;
case LOANRANKING: gm.LoanRanking(); break;
case ADDBOOK: gm.AddBook(); break;
case SEARCHBOOK:gm.SearchBook(); break;
case SELECTBOOK:gm.SelectBook(); break;
case LOANBOOK:gm.LoanBook(); break;
case RETURNBOOK:gm.ReturnkBook(); break;
case SHOWBOOK:gm.ShowBook(); break;
default:system("cls"); break;
}
}
return 0;
}