if (p->getname() == name && p->getwriter() == writer) {
p->setsum(sum + p->getsum());//书库中原来就有的话就将原来数量与现在的相加
k = 1;
break;
}
}
if (k == 0) {//书库中没有的话就加在链表末尾
p->setnext(name, writer, sum, bookclass);
savelink();
}
else {
savelink();
}
}
void delonenode(string name,string writer) {//----------------------删除某一本书
bookdate* p,*q=NULL;//记得测试尾节点
p = head;
while (p->getnext() != NULL) {
if (p->getnext()->getname() == name && p->getnext()->getwriter() == writer) {
if (p->getnext()->getnext() == NULL) {
q = p->getnext();
p->getnext() = NULL;
delete q;
break;
}
else {
q = p->getnext();
p->getnext() = p->getnext()->getnext();
delete q;
break;
}
}
p = p->getnext();
}
savelink();
}
void selectbook(string name,string writer) {//--------------------------查书
bookdate* p;
p = head;
while (p->getnext() != NULL) {
p = p->getnext();
if (p->getname() == name && p->getwriter() == writer) {
cout << “您找的图书信息如下:” << endl;
cout << “书名” << “\t” << “作者” << “\t” << “数量” << “\t” << “类别” << endl;
cout << p->getname() << “\t” << p->getwriter() << “\t” << p->getsum() << “\t” << p->getbookclass();
break;
}
}
}
void rebuildbook(string name,string writer,int sum,string bookclass) {//-改书
bookdate* p;
p = head;
while (p->getnext() != NULL) {
p = p->getnext();
if (p->getname() == name && p->getwriter() == writer) {
p->setsum(sum);
p->setbookclass(bookclass);
break;
}
}
savelink();
}
void printlink() {//-----------------------------------------------打印链表
bookdate* p;
p = head;
while (p->getnext() != NULL) {
p = p->getnext();
cout << p->getname() << " " << p->getwriter() <<" “<getsum()<<” "<getbookclass()<< endl;
}
}
};
class userbook {//------------------------------------------------用户借书登记信息
private:
string bookname;
string bookwriter;
int sum;
string name;
string phone;
userbook* next;
public:
userbook() {
next = NULL;
}
userbook(string bookname, string bookwriter, int sum, string name, string phone) {
this->bookname = bookname;
this->bookwriter = bookwriter;
this->sum = sum;
this->name=name;
this->phone = phone;
this->next = NULL;
}
void setnext(string bookname,string bookwriter,int sum,string name,string phone) {
this->next = new userbook(bookname,bookwriter, sum, name, phone);
}
void setsum(int sum) {
this->sum = sum;
}
userbook*& getnext() {
return next;
}
string getbookname() {
return bookname;
}
string getbookwriter() {
return bookwriter;
}
int getbooksum() {
return sum;
}
string getusername() {
return name;
}
string getuserphone() {
return phone;
}
};
class userbooklink {//-----------------------------------------------用户借书登记功能类
private:
userbook* head;
public:
userbooklink() {//-------------------------------------------------构造函数将文件里面的东西读出来
string bookname;
string bookwriter;
int sum=0;
string name;
string phone;
head = new userbook;
userbook* p=head;
ifstream infile;
infile.open(“用户借书信息”);
while (infile >> bookname >> bookwriter >> sum >> name >> phone) {
p->setnext(bookname, bookwriter, sum, name, phone);
p = p->getnext();
}
infile.close();
}
userbook* looklink(string bookname,string bookwriter,string name) {//有就返回,没有就返回空
userbook* p = head;int k = 0; //可以用来查重
while (p->getnext() != NULL) {
p = p->getnext();
if (p->getbookname() == bookname && p->getbookwriter() == bookwriter && p->getusername() == name) {
k = 1;
return p;
}
}
if (k == 0) {
return NULL;
}
}
void addonenode(string bookname, string bookwriter, int sum, string name, string phone) {
userbook* p = head;
while (p->getnext() != NULL) {
p = p->getnext();
}
p->setnext(bookname, bookwriter, sum, name, phone);
savelink();
}
void savelink() {//--------------------------------存链表
userbook* p;
p = head;
ofstream outfile;
outfile.open(“用户借书信息”);
while (p->getnext() != NULL) {
p = p->getnext();
outfile << p->getbookname() << " " << p->getbookwriter() << " " << p->getbooksum() << " " << p->getusername() <<" "<getuserphone()<< endl;
}
outfile.close();
}
void changesum(string bookname,string bookwriter,int sum,string name) {//修改书的数量
userbook* p = head;
while (p->getnext() != NULL) {
p = p->getnext();
if (p->getbookname() == bookname && p->getbookwriter() == bookwriter && p->getusername() == name) {
p->setsum(sum);
break;
}
}
savelink();
}
};
//-------------------------------------全局函数区----------------------------------
//用户与管理员
bool landkey(baselink* p, char n) {//登录,修改密码,注销账户,均需要输入密码,所以公用登陆器函数,以n的不同加以区分;
UaAdate * f = NULL;//用户与管理员的登陆器//1登录 4改密码 5注销
string id;
char passward[20];
string secproblem;
string secanswer;
int i = 0, j, k;
char ch = ‘0’;
cout << “请输入您的ID:”;
j = 0;k = 1;
IDD:
Here1:
id = “\0”;
cin >> id;
if (id.length() > 10) {
if (j > 2) {
system(“cls”);cout << “您多次操作失误,将要返回主菜单”;
return false;
}
cout << “您输入的ID不合规范,请重新输入:”;
j++;
goto Here1;
}
f = p->looklink(id);
if (f == NULL) {
cout << “您输入的id不存在,请重新输入:”;
if (k == 4) {
system(“cls”);cout << “您多次操作失误,将要返回主菜单”;
return false;
}
k++;
goto IDD;
}
cout << “请输入您的密码:”;
j = 0;k = 1;
PassWard:
Here2:
i = 0;
memset(passward, ‘\0’, sizeof(passward));
while (1) {
ch = _getch();//最后输入回车没有将回车存入密码中,而是将他给吃掉了;
if (ch == 13) {
break;
}
else {
if (ch != 8) {
if (i < 19) {//如果输入次数大于19就不再将从键盘读取的字符存进数组;
passward[i] = ch;
}
cout << “*”;
}
else {
if (i == 0) {
ch = ‘\0’;
i–;
}
else {
cout << “\b \b”;
passward[i - 1] = ‘\0’;
ch = ‘\0’;
i = i - 2;
}
}
}
i++;
}
cout << endl;
if (strlen(passward)> 19) {//当检测到密码有19个长度时就清理密码串,重新输入;
cout << “您的密码不合规范,请重新输入:”;//当小于等于18个长度时将跳过这个步骤;
j++;
if (j > 2) {
system(“cls”);cout << “您多次操作失误,将要返回主菜单”;
return false;//密码输入不合规范三次
}
goto Here2;
}
if (passward!=f->getpassward()) {
cout << “密码错误,请重新输入:”;
if (k == 4) {
system(“cls”);cout << “您多次密码输入错误,将要返回主菜单” << endl;
system(“pause”);
return false;
}
k++;
goto PassWard;
}
else {
if (n == ‘1’) {
system(“cls”);
cout << “登录成功!” << endl;
system(“date/t”);
system(“time/t”);
return true;
}
else if (n == ‘4’) {
cout << “为了您的账户安全,请输入您的密保!” << endl;
cout << “您的密保问题是:” << f->getsecproblem() << endl;
cin >> secanswer;
if (secanswer == f->getsecanswer()) {
cout << “请输入您新的密码:”;
string newpassward;
cin >> newpassward;
f->setpassward(newpassward);
p->savelink();
system(“cls”);
cout << “密码修改成功!”;
return true;
}
else {
system(“cls”);
cout << “您的证据不充分,修改失败!”;
return false;
}
}
else if (n == ‘5’) {
cout << “您的密保问题是:” << f->getsecproblem() << endl;
cout << “请输入您的密保答案:”;
cin >> secanswer;
if (secanswer == f->getsecanswer()) {
char t;
cout << “您确定要将账号注销吗?” << endl << “1.确认 2.我再犹豫一下” << endl << “please you chose”;
while (1) { t = _getch();if (t == ‘1’ || t == ‘2’)break; }
if (t == ‘1’) {
p->delnode(id);
p->savelink();
system(“cls”);
cout << endl << “注销账号成功!”;
return true;
}
else if (t == ‘2’) {
system(“cls”);
cout << endl << “您放弃了注销账号想要返回主菜单”;
return false;
}
}
else {
cout << “您的密保输入错误,注销账户失败!”;
return false;
}
}
}
}
//注册账号
bool regkey(baselink* p) {//用户与管理员的注册器
UaAdate* f = NULL;
string id;
string passward;
string secproblem;
string secanswer;
int j = 0, k = 1;
cout << “请您输入您的ID这将这将作为您登陆的账号:”;
IDD:
Here1:
cin >> id;
if (id.length() > 10) {
cout << “您输入的ID不合规范,请重新输入:”;
if (j == 3) {
cout << endl << “您多次操作失误,即将返回上一层” << endl;system(“pause”);
return false;
}
j++;
goto Here1;
}
else {
f = p->looklink(id);
if (f != NULL) {
cout << “此id已存在,请重新输入!”;
if (k == 3) {
cout << endl << “您多次操作失误,即将返回上一层” << endl;system(“pause”);
return false;
}
k++;
goto IDD;
}
}
cout << “请输入您的密码:”;
Here2:
cin >> passward;
if (passward.length() > 18) {
cout << “您输入的密码不合规范,请重新输入:”;
goto Here2;
}
cout << “设置您的密保(这将是您找回密码的重要依据):”;
cin >> secproblem;
cout << “请输入您密保的答案:”;
cin >> secanswer;
p->addnode(id, passward, secproblem, secanswer);//注册;
p->savelink();
cout << “注册成功!”;
return true;
}
//找回密码
bool lookpassward(baselink* p) {//找回密码,不需要输入密码
UaAdate * f = NULL;
string id;
string passward;;
string secproblem;
string secanswer;
int i = 0, j, k;
char ch = ‘0’;
cout << “请输入您的ID:”;
j = 0;k = 1;
IDD:
Here1:
id = “\0”;
cin >> id;
if (id.length() > 10) {
if (j > 2) {
cout << endl << “您多次操作失误,即将返回上一层” << endl;system(“pause”);
return false;
}
cout << “您输入的ID不合规范,请重新输入:”;
j++;
goto Here1;
}
f = p->looklink(id);
if (f == NULL) {
cout << “您输入的id不存在,请重新输入:”;
if (k == 4) {
cout << endl << “您多次操作失误,即将返回上一层” << endl;system(“pause”);
return false;
}
k++;
goto IDD;
}
cout << “您的密保问题是:” << f->getsecproblem() << endl;;
cout << “请输入您密保问题的答案:”;
cin >> secanswer;
if (secanswer == f->getsecanswer()) {
cout << “您的证据充分,您的账户信息如下:” << endl << “ID:” << f->getid() << endl << “密码:” << f->getpassward();
return true;
}
else {
cout << “您提供的证据不充分,密码找回失败”;
return false;
}
}
//对书进行操作的函数
void addbook() {
booklink B;
string name;
string writer;
string bookclass;
int sum,i=0;
cout << “请输入图书的名称:”;
cin >> name;
cout << “请输入图书作者:”;
cin >> writer;
cout << “请输入您要存的本数:”;
while (i < 3) {
cin >> sum;
if (sum <= 0)
{
cout << “您输入的数量不合法请重新输入:”;
sum = 0;
i++;
if (i == 2) {
cout << “您多次输入不合法,即将返回上一层” << endl;
system(“pause”);
return;
}
}
else break;
}
i = 0;
cout << “请输入您要存的书的种类(科学,文学,青春,爱情,恐怖):”<<endl;
while (i < 3) {
cin >> bookclass;
if (bookclass == “科学” || bookclass == “文学” || bookclass == “青春” || bookclass == “爱情” || bookclass == “恐怖”) {
break;
}
else {
cout << “您输入的种类不合法请重新输入:”;
i++;
if (i == 2) {
cout << “您多次输入错误,即将返回上一层” << endl;
system(“pause”);
return;
}
}
}
cout << “您确定要将此图书存入书库吗?” << endl;
cout << “1.确认无误 2.我不想存了” << endl;
cout << “please your choose:”;
char n=‘0’;
while (1) {
n = _getch();
if (n == ‘1’ || n == ‘2’) {
break;
}
}
if (n == ‘1’) {
B.creatnode( name,writer,sum,bookclass);
}
else {
return;
}
}
void delbook() {//-----------------------删除某一本书
booklink B;
bookdate *p = NULL;
string name;
string writer;
int i = 0;
cout << “请输入您要下架的书名:”;
cin >> name;
cout << “请输入您要下架图书的作者”;
cin >> writer;
p=B.looklink(name, writer);
if (p == NULL) {
cout << “您所查找的书不在书库内,不需要下架!” << endl << “返回上一层”;system(“pause”);
return;
}
else
{
cout << “检测到书库中确实有此书信息如下:”<<endl;
cout << “书名” << “\t” << “作者” << “\t” << “数量” << “\t” << “类别” << endl;
cout << p->getname()<<“\t” << p->getwriter()<<“\t” << p->getsum()<<“\t” << p->getbookclass()<<endl;
cout << “您确认删除该图书信息吗?”;
cout << “1.确认无误 2.我不想删除这本”;
char n = ‘0’;
while (1) {
n = _getch();
if (n == ‘1’ || n == ‘2’) {
break;
}
}
if (n == ‘1’) {
B.delonenode(name, writer);
}
else if (n == ‘2’) {
cout << “您放弃了删除书本,返回上一层” << endl;
system(“pause”);
}
}
}
void selectbook(){//---------------------查找某一本书------书名-------类别-------作者
booklink B;
string name;
string writer;
string bookclass;
int sum, i = 0;char n = ‘0’;
bookdate* p = NULL;
p = B.gethead();
cout<<endl << “1.按书名” << endl << “2.按作者” << endl << “3.按类别” << endl;
while (1) {
n = _getch();
if (n == ‘1’ || n == ‘2’ || n == ‘3’) {
break;
}
}
if (n == ‘1’) {
cout << “请输入您要查找的书名:”;
cin >> name;
cout << “您要查找的结果如下(如果列表为空,则没有查到您要找的书):” << endl;
cout << “书名” << “\t” << “作者” << “\t” << “数量” << “\t” << “类别” << endl;
while (p->getnext() != NULL) {
p = p->getnext();
if(p->getname()==name)
cout << p->getname() << “\t” << p->getwriter() << “\t” << p->getsum() << “\t” << p->getbookclass() << endl;
}
}
else if (n == ‘2’) {
cout << “请输入您要查找的作者”;
cin >> writer;
cout << “您要查找的结果如下(如果列表为空,则没有查到您要找的书):” << endl;
cout << “书名” << “\t” << “作者” << “\t” << “数量” << “\t” << “类别” << endl;
while (p->getnext() != NULL) {
p = p->getnext();
if (p->getwriter()==writer)
cout << p->getname() << “\t” << p->getwriter() << “\t” << p->getsum() << “\t” << p->getbookclass() << endl;
}
}
else if (n == ‘3’) {
cout << “请输入您要查找的书的类型:”;
while (i < 3) {
cin >> bookclass;
if (bookclass == “科学” || bookclass == “文学” || bookclass == “青春” || bookclass == “爱情” || bookclass == “恐怖”)
break;
else {
cout << “你输入的种类不合法,请重新输入:”;
i++;
if (i == 2) {
cout << “您多次输入不合法,即将返回主菜单” << endl;
system(“pause”);
return;
}
}
}
cout << “您要查找该类书的结果如下(如果列表为空,则没有查到您要找的书):” << endl;
cout << “书名” << “\t” << “作者” << “\t” << “数量” << endl;
while (p->getnext() != NULL) {
p = p->getnext();
if (p->getbookclass()==bookclass)
cout << p->getname() << “\t” << p->getwriter() << “\t” << p->getsum()<< endl;
}
}
}
void rebuildbook() {//-------------------修改某一本书
booklink B;
string name;
string writer;
string bookclass;
int sum, i = 0;
bookdate* p;
char n;
//p = B.gethead();
cout << “请输入您要修改的书名:”;
cin >> name;
cout << “请输入您要修改书的作者:”;
cin >> writer;
p = B.looklink(name,writer);
if (p == NULL) {
cout << “书库中没有找到该书,即将返回主菜单” << endl;system(“pause”);return;
}
else {
system(“cls”);
cout << “书库中找到了您所要修改的书,信息如下:”<<endl;
cout << “书名” << “\t” << “作者” << “\t” << “数量” << “\t” << “类别” << endl;
cout << p->getname() << “\t” << p->getwriter() << “\t” << p->getsum() << “\t” << p->getbookclass() << endl;
cout << “请输入您要修改的类型:” << endl;
cout << “1.数量 2.类型”;
while (1) {
n = _getch();
if (n == ‘1’ || n == ‘2’) {
break;
}
}
if (n == ‘1’) {
i = 0;
cout<<endl << “请输入新的图书数量:”;
while (i < 3) {
cin >> sum;
if (sum > 0) {
break;
}
else {
cout << “您输入的数量不合法请重新输入:”;
i++;
sum = 0;
if (i == 2) {
cout << “您多次操作失误,将要返回主菜单” << endl;
system(“pause”);
return;
}
}
}
B.rebuildbook(p->getname(), p->getwriter(), sum, p->getbookclass());
cout << “修改成功,即将返回主菜单” << endl;
system(“pause”);
return;
}
else if (n == ‘2’) {
i = 0;
cout<<endl << “请输入新的图书类别:”;
while (i < 3) {
cin >> bookclass;
if (bookclass == “科学” || bookclass == “文学” || bookclass == “青春” || bookclass == “爱情” || bookclass == “恐怖”)
break;
else {
cout << “您输入的类别不合法,请重新输入:”;
i++;
if (i == 2) {
cout << “您多次操作失误,即将返回主菜单!”;
system(“pause”);
return;
}
}
}
B.rebuildbook(p->getname(),p->getwriter(),p->getsum(),bookclass);
cout << “更改成功,即将返回主菜单!” << endl;
system(“pause”);
return;
}
}
}
void sortbook() {
booklink B;
bookdate* p,*q,t;
p = B.gethead();
for (p=p->getnext();p->getnext() != NULL;p = p->getnext()) {
for (q = p->getnext();q != NULL;q = q->getnext()) {
if (p->getsum() < q->getsum()) {
t = *p;
*p = *q;
*q = t;
t.getnext() = p->getnext();
p->getnext() = q->getnext();
q->getnext() = t.getnext();
}
}
}
p = B.gethead();
cout << “书库中书的信息如下:” << endl;
cout << “名称” << “\t” << “作者” << “\t” << “数目” << “\t” << “书的类别” << endl;
while (p->getnext() != NULL) {
p = p->getnext();
cout << p->getname() << “\t” << p->getwriter() << “\t” << p->getsum() << “\t” << p->getbookclass()<<endl;
}
}
void userlendbook() {//---------------------------------------------------用户借书
booklink B;
bookdate *Bp = NULL;
userbooklink U;
userbook *Up = NULL;
string bookname;
string bookwriter;
int sum = 0;
string name;
string phone;int i = 0;
cout << “请输入您想要借阅的图书名:”;
cin >> bookname;
cout << “请输入您想借阅的图书作者:”;
cin >> bookwriter;
cout << “请输入您的姓名:”;
cin >> name;
Bp=B.looklink(bookname,bookwriter);
Up = U.looklink(bookname,bookwriter,name);
if (Bp == NULL||Up!=NULL&&Up->getbooksum()>0) {
if (Bp == NULL) {
cout << “书库中没有找到您要借的书,即将返回上一层” << endl;
system(“pause”);
system(“cls”);
}
else if (Up != NULL&&Up->getbooksum()>0) {
cout << “您之前借过该书但没有还,请您还了之后再来借书,即将返回上一层” << endl;
system(“pause”);
system(“cls”);
}
return;
}
else if (Bp != NULL && Up != NULL && Up->getbooksum() == 0) {
cout << “系统检测到您之前借过书,但已归还,请输入您再借的本数:”;
while (i < 3) {
cin >> sum;
if (sum > 0 && sum <= Bp->getsum()) {
break;
}
else {
cout << “您输入的数量不合法,请重新输入:”;
i++;
sum = 0;
if (i == 2) {
cout << “您操作失误次数太多,即将返回主菜单” << endl;
system(“pause”);
return;
}
}
}
B.rebuildbook(Bp->getname(), Bp->getwriter(), Bp->getsum() - sum, Bp->getbookclass());
Up->setsum(sum);
U.savelink();
cout << “借书成功!” << endl;
system(“pause”);
system(“cls”);
}
else {
cout << “书库中找到了您所要借阅的书,信息如下:” << endl;
cout << “书名” << “\t” << “作者” << “\t” << “数量” << “\t” << “类别” << endl;
cout << Bp->getname() << “\t” << Bp->getwriter() << “\t” << Bp->getsum() << “\t” << Bp->getbookclass() << endl;
cout << “请输入您要借阅的数量:”;
while (i < 3) {
cin >> sum;
if (sum > 0&&sum<=Bp->getsum()) {
break;
}
else {
cout << “您输入的数量不合法,请重新输入:”;
i++;
sum = 0;
if (i == 2) {
cout << “您操作失误次数太多,即将返回主菜单” << endl;
system(“pause”);
return;
}
}
}
cout << “为了便于联系,请您留下电话号码:”;
cin >> phone;
cout << “您确定要借阅” << Bp->getname() << “书” << sum << “本吗?” << endl;
cout << “1.确定借阅 2.我再犹豫一下” << endl;
char n = ‘0’;
while (1) {
n = _getch();
if (n == ‘1’ || n == ‘2’) {
break;
}
}
if (n == ‘1’) {//--------------------------------------------------------------
B.rebuildbook(Bp->getname(),Bp->getwriter(), Bp->getsum()-sum, Bp->getbookclass());
U.addonenode(bookname, bookwriter, sum, name, phone);
cout << “借书成功!” << endl;
system(“pause”);
system(“cls”);
return;
}
else {
cout << “您放弃了借书,即将返回主菜单” << endl;
system(“pause”);
system(“cls”);
return;
}
}
}
void brobook() {//---------------------------------------------------还书
booklink B;
bookdate* Bp = NULL;
userbooklink U;
userbook* Up = NULL;
string bookname;
string bookwriter;
int sum = 0;
string name;
string phone;int i = 0;
cout << “请输入您借的书名”;
cin >> bookname;
cout << “请输入您借书的作者”;
cin >> bookwriter;
cout << “请输入您的姓名:”;
cin >> name;
Bp = B.looklink(bookname, bookwriter);
Up = U.looklink(bookname, bookwriter, name);
if (Up == NULL) {
cout << “系统没有检测到您的借书记录,即将返回” << endl;
system(“pause”);
system(“cls”);
return;
}
else {
cout << “系统检测到您的借书记录,如下:” << endl;
cout << “书名”<<“\t”<<“作者”<<“\t”<<“待还数量”<<endl;
cout << Up->getbookname() << “\t” << Up->getbookwriter() << “\t” << Up->getbooksum() << endl;
cout << “请输入您要还书的数量:”;
while (i < 3) {
cin >> sum;
if (sum > 0 && sum <= Up->getbooksum()) {
break;
}
else {
i++;
if (i == 2) {
cout << “您多次输入不合法,即将返回主菜单”;
system(“pause”);
system(“cls”);
return;
}
cout << “您输入的数量不合法,请重新输入:”;
sum = 0;
}
}
U.changesum(bookname,bookwriter,Up->getbooksum()-sum,name);
B.rebuildbook(Bp->getname(),Bp->getwriter(),Bp->getsum()+sum,Bp->getbookclass());
cout << “还书成功!”;
system(“pause”);
system(“cls”);
return;
}
}
//---------------------------------------------------菜单区
char Shield_4() {
char a;
while (1) {
a = _getch();
if (a >= ‘1’ && a <= ‘4’) {
break;
}
}
return a;
}
char Shield_6() {
char a;
while (1) {
a = _getch();
if (a >= ‘1’ && a <= ‘6’) {
break;
}
}
return a;
}
bool Usermeun() {//用户主菜单
char n;bool k;
UserHere:
system(“cls”);
cout << “\n\n\n”;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t–欢迎光临–\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t1.我想借书\t\t\t\t *” << endl;//借书时可以查看图书
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t2.我想还书\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t3.我想查找书\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t4.退出登录\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl << endl;
cout << “————————————————————————————————————————————————————————————”;
cout << “请输入您要进行操作对应的编号:”;
n = Shield_4();
if (n == ‘1’) {
userlendbook();
goto UserHere;
}
else if (n == ‘2’) {
brobook();
goto UserHere;
}
else if (n == ‘3’) {
selectbook();
system(“pause”);
goto UserHere;
}
else if (n == ‘4’) {
return false;
}
}
bool Admmeun() {//管理员主菜单
char n;bool k;
AdmHere:
system(“cls”);
cout << “\n\n\n”;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t–管理员我们又见面了–\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t1.图书入库\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t2.书库查书\t\t\t\t *” << endl;//查看书库中是否有该图书
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t3.下架图书\t\t\t\t *” << endl;//1.彻底下架(删除图书) 2.下架部分图书(修改图书数量)
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t4.修改图书信息\t\t\t\t *” << endl;//修改图书价格
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t5.查看书库中所有图书\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t6.退出登录\t\t\t\t *” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl << endl;
cout << “————————————————————————————————————————————————————————————”;
cout << “请输入您要进行操作对应的编号:”;
n = Shield_6();
if (n == ‘1’) {//增
addbook();
system(“pause”);
goto AdmHere;
}
else if (n == ‘2’) {//查
selectbook();
system(“pause”);
goto AdmHere;
}
else if (n == ‘3’) {//删
delbook();
system(“pause”);
goto AdmHere;
}
else if (n == ‘4’) {//改
rebuildbook();
system(“pause”);
goto AdmHere;
}
else if (n == ‘5’) {//排序
sortbook();
system(“pause”);
goto AdmHere;
}
else if (n == ‘6’) {//回主菜单
return false;
}
}
bool thisMenu(baselink* p) {//登录界面
char n;bool k;
Here:
system(“cls”);
cout << “\n\n\n”;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t–欢迎光临–\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t1.登录\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t2.注册\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t3.找回密码\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t4.修改密码\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t5.注销账户\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t6.回主菜单\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl << endl;
cout << “————————————————————————————————————————————————————————————”;
cout << “请输入您要进行操作对应的编号:”;
n = Shield_6();
if (n == ‘1’) {//-----------------------登录
k=landkey(p, ‘1’);
if (k == false) {
system(“pause”);
goto Here;
}
else {
return true;
}
}
else if (n == ‘2’) {//------------------注册
regkey§;
system(“pause”);
goto Here;
}
else if (n == ‘3’) {//------------------找回密码
lookpassward§;
system(“pause”);
goto Here;
}
else if (n == ‘4’) {//------------------修改密码
landkey(p, ‘4’);
system(“pause”);
goto Here;
}
else if (n == ‘5’) {//-------------------注销账户
landkey(p, ‘5’);
system(“pause”);
goto Here;
}
else if (n == ‘6’) {//-------------------返回主菜单
return false;
}
}
void mainMenu() {//主菜单
cout << “\n\n\n”;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t–图书管理系统–\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t1.我是用户\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t2.我是管理员\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t3.主题设置\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t4.退出\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl << endl;
cout << “————————————————————————————————————————————————————————————”;
cout << “请输入您要进行操作对应的编号:”;
}
//-------------------------------------------------------------辅助功能区
void setColor() {
//设置颜色
char n, k;
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数前端工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新
如果你觉得这些内容对你有帮助,可以添加V获取:vip1024c (备注前端)
基础面试题
CodeChina开源项目:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】
主要内容包括:HTML,CSS,JavaScript,浏览器,性能优化等等
--------*" << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t–图书管理系统–\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t1.我是用户\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t2.我是管理员\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t3.主题设置\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t4.退出\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t *\t\t\t\t\t\t\t\t *” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl;
cout << “\t\t\t ---------------------------------------------------------------” << endl << endl;
cout << “————————————————————————————————————————————————————————————”;
cout << “请输入您要进行操作对应的编号:”;
}
//-------------------------------------------------------------辅助功能区
void setColor() {
//设置颜色
char n, k;
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数前端工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
[外链图片转存中…(img-lkfcodNb-1711831090358)]
[外链图片转存中…(img-WuSxmq4X-1711831090359)]
[外链图片转存中…(img-L7cVXnzE-1711831090359)]
[外链图片转存中…(img-IDAUwCXS-1711831090360)]
[外链图片转存中…(img-o4IIn48X-1711831090360)]
[外链图片转存中…(img-q2tNDMIN-1711831090360)]
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新
如果你觉得这些内容对你有帮助,可以添加V获取:vip1024c (备注前端)
[外链图片转存中…(img-TL3VoPzl-1711831090361)]
基础面试题
CodeChina开源项目:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】
主要内容包括:HTML,CSS,JavaScript,浏览器,性能优化等等