cout<<"$$$void reader::rentbook(){
cout<<"$$$$1:借书\t2:还书\t0:退出系统$$$$"<<endl;
int leng=0;
while(cin>>leng){
switch(leng){
case 0:cout<<"欢迎您的使用!谢谢再见!"<<endl;exit(0);
case 1:while(leng){
if(top=0||MAX==top){
break;
}
cout<<"请输入图书书名"<<endl;
cin>>na;
cout<<"请输入图书编号"<<endl;
cin>>n;
cout<<"请输入图书作者"<<endl;
cin>>au;
for(int i=0;i<5;i++){
if(rent[i].name==na&&rent[i].no==n&&rent[i].author==au&&rent[i].flag==1){
cout<<"借书成功"<<endl;
rent[i].flag=0;
top++;
}
else if(rent[i].name==na&&rent[i].no==n&&rent[i].author==au&&rent[i].flag==0){
cout<<"您要的图书已经借出"<<endl;
}
else{
cout<<"图书馆没有您要的图书"<<endl;
break;
}
}
}
case 2:if(top==0){
cout<<"没有书籍可还"<<endl;
}
else{
cout<<"请输入所还书名"<<endl;
cin>>na;
for(int i=0;i<5;i++){
if(rent[i].name==na){
rent[i].flag=1;
cout<<"还书成功"<<endl;
break;
}
}
}
default:cout<<"please input the right number!!";break;
}
cout<<"$$$$1:借书\t2:还书\t0:退出系统$$$$"<<endl;
}
}
:借书\t2:还书\t0:退出系统$$$$"<<endl; cout<<"$$$void reader::rentbook(){
cout<<"$$$$1:借书\t2:还书\t0:退出系统$$$$"<<endl;
int leng=0;
while(cin>>leng){
switch(leng){
case 0:cout<<"欢迎您的使用!谢谢再见!"<<endl;exit(0);
case 1:while(leng){
if(top=0||MAX==top){
break;
}
cout<<"请输入图书书名"<<endl;
cin>>na;
cout<<"请输入图书编号"<<endl;
cin>>n;
cout<<"请输入图书作者"<<endl;
cin>>au;
for(int i=0;i<5;i++){
if(rent[i].name==na&&rent[i].no==n&&rent[i].author==au&&rent[i].flag==1){
cout<<"借书成功"<<endl;
rent[i].flag=0;
top++;
}
else if(rent[i].name==na&&rent[i].no==n&&rent[i].author==au&&rent[i].flag==0){
cout<<"您要的图书已经借出"<<endl;
}
else{
cout<<"图书馆没有您要的图书"<<endl;
break;
}
}
}
case 2:if(top==0){
cout<<"没有书籍可还"<<endl;
}
else{
cout<<"请输入所还书名"<<endl;
cin>>na;
for(int i=0;i<5;i++){
if(rent[i].name==na){
rent[i].flag=1;
cout<<"还书成功"<<endl;
break;
}
}
}
default:cout<<"please input the right number!!";break;
}
cout<<"$$$$1:借书\t2:还书\t0:退出系统$$$$"<<endl;
}
}
:借书\t2:还书\t0: