欢迎来到天天文库
浏览记录
ID:38682373
大小:17.86 KB
页数:21页
时间:2019-06-17
《图书馆管理系统代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include#defineDEBUG0//宏定义决定测试代码是否编译0为不编译非0则编译constcharbook_path[20]="books.txt";constcharreader_path[20]="readers.txt";//文件读写声明voidread_from_files_to_vector();voidwrite_all_to_files();#ifDEBUGvoidscan_readers(){for(reader&s:readers){wcout<2、.imbue(china);wcout.imbue(china);read_from_files_to_vector();#ifDEBUGcout<<"sizeofreaders="<3、t<<"--------------------请选择登录方式--------------------"<>a;cleanScreen();if(a==1){stringstr;for(intj=0;j<=4;j++){cout<<"请输入管理密码,你有"<<(4-j)<<"次机会"<>str;if(password==str){break;}elsecout<<"密码错误!请重新输入"<4、-----欢迎来到图书管理系统-------------"<>b;cleanScreen();while(b!=5){switch(b){cas5、e1:scan_book();break;case2:modify_book();break;case3:add_book();break;case4:delete_book();break;default:cout<<"输入错误,请重新输入";break;}cout<6、dl;cout<<"--------------请选择操作选项编号--------------"<>b;cleanScreen();}write_all_to_files();return0;}elseif(a==2){intreaderIndex=0;//记录读者下标//输入学号登陆cout<<"--------------请输入学号--------------"<>studentnu7、mber;intt;for(t=0;t
2、.imbue(china);wcout.imbue(china);read_from_files_to_vector();#ifDEBUGcout<<"sizeofreaders="<3、t<<"--------------------请选择登录方式--------------------"<>a;cleanScreen();if(a==1){stringstr;for(intj=0;j<=4;j++){cout<<"请输入管理密码,你有"<<(4-j)<<"次机会"<>str;if(password==str){break;}elsecout<<"密码错误!请重新输入"<4、-----欢迎来到图书管理系统-------------"<>b;cleanScreen();while(b!=5){switch(b){cas5、e1:scan_book();break;case2:modify_book();break;case3:add_book();break;case4:delete_book();break;default:cout<<"输入错误,请重新输入";break;}cout<6、dl;cout<<"--------------请选择操作选项编号--------------"<>b;cleanScreen();}write_all_to_files();return0;}elseif(a==2){intreaderIndex=0;//记录读者下标//输入学号登陆cout<<"--------------请输入学号--------------"<>studentnu7、mber;intt;for(t=0;t
3、t<<"--------------------请选择登录方式--------------------"<>a;cleanScreen();if(a==1){stringstr;for(intj=0;j<=4;j++){cout<<"请输入管理密码,你有"<<(4-j)<<"次机会"<>str;if(password==str){break;}elsecout<<"密码错误!请重新输入"<4、-----欢迎来到图书管理系统-------------"<>b;cleanScreen();while(b!=5){switch(b){cas5、e1:scan_book();break;case2:modify_book();break;case3:add_book();break;case4:delete_book();break;default:cout<<"输入错误,请重新输入";break;}cout<6、dl;cout<<"--------------请选择操作选项编号--------------"<>b;cleanScreen();}write_all_to_files();return0;}elseif(a==2){intreaderIndex=0;//记录读者下标//输入学号登陆cout<<"--------------请输入学号--------------"<>studentnu7、mber;intt;for(t=0;t
4、-----欢迎来到图书管理系统-------------"<>b;cleanScreen();while(b!=5){switch(b){cas
5、e1:scan_book();break;case2:modify_book();break;case3:add_book();break;case4:delete_book();break;default:cout<<"输入错误,请重新输入";break;}cout<6、dl;cout<<"--------------请选择操作选项编号--------------"<>b;cleanScreen();}write_all_to_files();return0;}elseif(a==2){intreaderIndex=0;//记录读者下标//输入学号登陆cout<<"--------------请输入学号--------------"<>studentnu7、mber;intt;for(t=0;t
6、dl;cout<<"--------------请选择操作选项编号--------------"<>b;cleanScreen();}write_all_to_files();return0;}elseif(a==2){intreaderIndex=0;//记录读者下标//输入学号登陆cout<<"--------------请输入学号--------------"<>studentnu
7、mber;intt;for(t=0;t
此文档下载收益归作者所有