ImageVerifierCode 换一换
格式:DOC , 页数:16 ,大小:59.04KB ,
资源ID:3635758      下载积分:8 金币
验证码下载
登录下载
邮箱/手机:
验证码: 获取验证码
温馨提示:
支付成功后,系统会自动生成账号(用户名为邮箱或者手机号,密码是验证码),方便下次登录下载和查询订单;
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/3635758.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  
声明  |  会员权益     获赠5币     写作写作

1、填表:    下载求助     留言反馈    退款申请
2、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
3、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
4、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
5、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【丰****】。
6、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
7、本文档遇到问题,请及时私信或留言给本站上传会员【丰****】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。

注意事项

本文(图书馆管理系统---c语言编写.doc)为本站上传会员【丰****】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4008-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

图书馆管理系统---c语言编写.doc

1、#include stdio.h#include stdlib.h#include conio.h#include string.h#include math.h#define LEN sizeof(struct library)#define LEN1 sizeof(struct reader)#define NULL 0struct library/图书馆构造体int shuhao,xcl;char name20,author20,chuban20;struct library *next;struct reader/读者构造体int zhenghao;char mingzi20,riqi

2、20,zname20;struct reader *next;void mainmenu() /显示主菜单 system (cls); printf(n); printf(tttt#nn); printf(tttt 1.图书馆信息nn); printf(tttt 2.借阅系统nn); printf(tttt 3.退出系统nn); printf(ttt 请按键选择,回车拟定n); printf(tttt#n); printf(n); return ;void menu1() /显示图书馆信息菜单 system (cls); printf(); printf(tttt#nn); printf(tt

3、tt 1.采编入库nn); printf(tttt 2.清除库存nn); printf(tttt 3.图书查询nn); printf(tttt 4.库存一览nn); printf(tttt 5.返回上一层nn); printf(ttt 请按键选择,回车拟定n); printf(tttt#n); printf(n); return ;void menu2() /显示查询菜单 system (cls); /printf(); printf(tttt#n); printf(tttt 1.书号查询nn); printf(tttt 2.书名查询nn); printf(tttt 3.作者查询nn); pr

4、intf(tttt 4.出版社查询nn); printf(ttt 请按键选择,回车拟定n); printf(tttt#n); /printf(); return ;void main()/主函数,调用main1void main1();main1();void main1()/main1函数void tsgxx();/声明 void jieshuxitong();/声明 char choose; mainmenu(); scanf(%c,&choose); switch(choose)/功能函数选择 case 1:tsgxx();break; case 2:jieshuxitong();bre

5、ak; case 3:system (cls);printf(nnnnnnnnnttt Byebye.);printf(nnnnnnnnnttt 欢迎使用本软件!);getch();exit(0);system (cls);break; void tsgxx()/图书馆信息函数 void tsjinku(); void shanchu(); void chaxunts(); void xianshikucun();/函数声明 char choose; menu1();/调用菜单函数 scanf(%c,&choose); scanf(%c,&choose); for (;) switch(cho

6、ose)/功能函数选择 case 1:tsjinku();break; case 2:shanchu();break; case 3:chaxunts();break; case 4:xianshikucun();break; case 5:main1();break; int tjzs()/记录文本个数函数 FILE *fp; int tshuhao=0,txcl=0,n; char tname20=0,tauthor20=0,tchuban20=0; fp=fopen(library.txt,r);/打开文献 for (n=0;!feof(fp);n+)/逐个读文献 fscanf(fp,%

7、d %s %s %s %d,&tshuhao,tname,tauthor,tchuban,&txcl); n-; fclose(fp);/关闭文献 return (n);/返回个数int tjdzzs()/记录文本个数函数 FILE *fp; int zhenghao=0,n; char mingzi20=0,riqi20=0,zname20=0; fp=fopen(reader.txt,r);/打开文献 for (n=0;!feof(fp);n+)/逐个读文献 fscanf(fp,%d %s %s %s ,&zhenghao,&mingzi,&riqi,&zname); fclose(fp)

8、;/关闭文献 return (n);/返回个数void tsjinku()/图书进库函数 FILE *fp; int shuhao=0,xcl=0,n=0; char name20=0,author20=0,chuban20=0; char hitkey; system (cls); if (fp=fopen(library.txt,r)=NULL)/打开图书馆文献,不存在此文献则新建 fp=fopen(library.txt,w); fclose(fp); fp=fopen(library.txt,a); printf(nnnnnnttt请按如下格式输入图书信息:tttttt 书号 书名 作

9、者 出版社 进库量n请输入:);/按格式输入图书馆信息 for (;hitkey!=27;)/循环输入 if (n!=0) printf(请输入:); scanf(%d%s%s%s%d,&shuhao,name,author,chuban,&xcl); fprintf(fp,%d %s %s %s %dn,shuhao,name,author,chuban,xcl); printf(继续输入请按回车,结束输入请按escn); n+; hitkey=getch(); for (;hitkey!=13&hitkey!=27;) hitkey=getch(); fclose(fp); printf(

10、nnnnnnttt保存成功,按任意键返回上一层!); getch(); tsgxx();/返回上一层void shanchu()/删除图书信息函数 struct library *head=NULL; struct library *p,*p1,*p2; int tshuhao=0,txcl=0,n=0,j,i; char tname20=0,tauthor20=0,tchuban20=0, ttname20=0; char hitkey; FILE *fp; if (fp=fopen(library.txt,r)=NULL)/打开文献 system (cls); printf(nnnnnnn

11、nnttt记录文献不存在!按任意键返回.); getch(); tsgxx(); else system (cls); printf(nnnnnnnntt请输入你要删除旳书名:);/输入删除图书书名 scanf(%s,&ttname); printf(tt确认删除请回车,取消请按escn); hitkey=getch(); for (;hitkey!=13&hitkey!=27;) hitkey=getch(); if (hitkey=27) tsgxx(); fp=fopen(library.txt,r); for (j=0;!feof(fp);)/读文献夹信息,记录个数 j+; fscan

12、f(fp,%d%s%s%s%d,&tshuhao,tname,tauthor,tchuban,&txcl); fclose(fp); fp=fopen(library.txt,r); for (i=1;inext=p1; p2=p1; p1=(struct library*)malloc(LEN);/新建链表 p1-shuhao=tshuhao;/复制书号 strcpy(p1-name,tname);/复制书名 strcpy(p1-author,tauthor);/复制作者名子 strcpy(p1-chuban,tchuban);/复制出版社 p1-xcl=txcl;/复制个数 if (n=0

13、) head=NULL; else p2-next=p1; p1-next=NULL; fclose(fp); fp=fopen(library.txt,w);/清空文献 fclose(fp); fp=fopen(library.txt,a);/追加文献 p=head; for (;p!=NULL;)/把链表内容覆盖到文献 fprintf(fp,%d %s %s %s %d n,p-shuhao,p-name,p-author,p-chuban,p-xcl); p=p-next; fclose(fp);/关闭文献 system (cls); printf(nnnnnnnntt 删除成功 ntt

14、按任意键返回上一层n); getch();/返回上一层 tsgxx();void chaxunts()/查询函数 FILE *fp; char choose; int ttshuhao=0,tshuhao=0,txcl=0,n=0,k=0,i,l; char tname20=0,ttauthor20=0,tauthor20=0,ttchuban20=0,tchuban20=0, ttname20=0; if (fp=fopen(library.txt,r)=NULL)/打开文献 system (cls); printf(nnnnnnnnnttt记录文献不存在!按任意键返回.); getch()

15、; tsgxx(); l=tjzs();/获得文献个数 menu2();/调用菜单函数 scanf(%c,&choose);scanf(%c,&choose);/选择查询方式 if (choose=5) return; else if (choose=1)/书号查询 system (cls); printf(请输入书号:); scanf(%d,&ttshuhao); else if (choose=2)/书名查询 system (cls); printf(请输入书名:); scanf(%s,ttname); else if (choose=3)/作者查询 system (cls); print

16、f(请输入作者:); scanf(%s,ttauthor); else if (choose=4)/出版社查询 system (cls); printf(请输入出版社:); scanf(%s,ttchuban); system (cls); for (i=0;il;i+) fscanf(fp,%d%s%s%s%d,&tshuhao,tname,tauthor,tchuban,&txcl);/读文献信息 if (ttshuhao=tshuhao|!strcmp(ttname,tname)|!strcmp(ttauthor,tauthor)|!strcmp(ttchuban,tchuban)/输出

17、查询信息 if (k=0) printf(tttt查询成果:nn); printf(t 书号 书名 作者 出版社 现存量 n); printf(t %-4d %-8s %-8s %-8s %-4d n,tshuhao,tname,tauthor,tchuban,txcl); k+; if (k=0)/文献夹为空则输出无记录 system (cls); printf(nnnnnnntttt无符合记录!n); getch(); tsgxx(); fclose(fp); getch();/返回 tsgxx();void xianshikucun()/现实库存信息 FILE *fp; int shuh

18、ao=0,xcl=0,n=0,i=0,j=0; char name20=0,author20=0,chuban20=0; if (fp=fopen(library.txt,r)=NULL)/打开文献夹 system (cls); printf(nnnnnnnnnttt记录文献不存在!); n= tjzs(); if (n=0) system (cls); printf(nnnnnnnnnttt无任何记录!); fp=fopen(library.txt,r); system (cls); printf(*); printf(t 书号 书名 作者 出版社 库存量 n); printf(*); fo

19、r (i=0;in;i+)/输出信息 fscanf(fp,%d%s%s%s%d,&shuhao,name,author,chuban,&xcl); printf(t %-4d %-8s %-8s %-8s %-4d n,shuhao,name,author,chuban,xcl); fclose(fp); printf(tttt按任意键返回n); getch();/返回 tsgxx();void menu3() /显示借书系统主菜单 system (cls); /printf(*); printf(tttt#n); printf(tttt 1.借书登记nn); printf(tttt 2.还书

20、登记nn); printf(tttt 3.借阅状况查看nn); printf(tttt 4.返回上一层nn); printf(ttt 请按键选择,回车拟定n); printf(tttt#n); /printf(*); return ;void jieshuxitong()/借书系统函数 void jieshu(); void huanshu(); void duzheyilang();/函数声明 char choose; menu3(); scanf(%c,&choose); scanf(%c,&choose);/选择功能 for (;) switch(choose)/调用函数 case 1:

21、jieshu();break; case 2:huanshu();break; case 3:duzheyilang();break; case 4:main1();break; void jieshu()/借书函数 FILE *fp,*fp3; struct library *head=NULL; struct library *p,*p1,*p2; int tshuhao=0,txcl=0,i,loop,zhenghao=0,n=0,k=0,t=0,flag=0; char tname20=0,tauthor20=0,tchuban20=0, ttname20=0,mingzi20=0,r

22、iqi20=0,zname20=0; char hitkey=0; system (cls); if (fp=fopen(library.txt,r)=NULL)/打开图书馆文献 system (cls); printf(nnnnnnnnntt 图书馆无库存!按任意键退出!); getch(); exit (0); else printf(nnnnnnttt请输入借阅书名:tttttt n请输入:);/输入书名 scanf(%s,zname); k= tjzs();/记录图书馆文献个数 for (i=0;inext=p1; p2=p1; p1=(struct library*)malloc(L

23、EN);/新建链表 p1-shuhao=tshuhao;/复制书号 strcpy(p1-name,tname);/复制书名 strcpy(p1-author,tauthor);/复制作者 strcpy(p1-chuban,tchuban);/复制出版社 p1-xcl=txcl;/复制现存量 if (n=0) head=NULL; else p2-next=p1; p1-next=NULL; fclose(fp); p=head; for (;p!=NULL;)/读链表 if(!(strcmp(p-name,zname)/名字相似 flag=1;/标记取1 loop=p-xcl;/现存量减1 (

24、p-xcl)-; p=p-next; if(flag&(loop0)/存在借书书名且现存量大于0 fp=fopen(library.txt,w); fclose(fp); fp=fopen(library.txt,a); p=head; for (;p!=NULL;) fprintf(fp,%d %s %s %s %d n,p-shuhao,p-name,p-author,p-chuban,p-xcl); p=p-next; free(p);/把链表内容覆盖文献 fclose(fp); if(flag&(loop0)/存在借书书名且现存量大于0 if (fp3=fopen(reader.txt

25、,r)=NULL)/建读者文献夹 fp3=fopen(reader.txt,w); fclose(fp3); fp3=fopen(reader.txt,a); if (n!=0) printf(nnnnnnttt请按如下格式输入读者信息:tttttt 证号 姓名 归还日期 借书书名n请输入:);/录入读者信息 scanf(%d %s %s %s,&zhenghao,&mingzi20,&riqi20,&zname20); fprintf(fp3,%d %s %s %s n,zhenghao,&mingzi20,&riqi20,&zname20); fp=fopen(library.txt,w)

26、;/删除图书馆文献信息 fclose(fp); fp=fopen(library.txt,a);/重新追加信息 p=head; for (;p!=NULL;)/把链表内容覆盖图书馆文献 fprintf(fp,%d %s %s %s %d n,p-shuhao,p-name,p-author,p-chuban,p-xcl); p=p-next; fclose(fp); fclose(fp3); printf(成功!按任意键返回n); getch();/返回 jieshuxitong(); jieshuxitong(); else printf(此书已被借完!按任意键返回!);/否则输出此书已被接

27、完 getch();/返回 jieshuxitong(); void huanshu()/还书函数FILE *fp,*fp3; struct reader *head=NULL; struct reader *p,*p1,*p2; struct library *lhead1=NULL; struct library *zp1,*lp1,*lp2; int tshuhao=0,txcl=0,i; char tname20=0,tauthor20=0,tchuban20=0, ttname20=0; int ttzhenghao=0,tzhenghao=0,n=0,k=0,t=0,flag=0;

28、 char tmingzi20=0,triqi20=0,tzname20=0,ttzname20=0; char hitkey=0; system (cls); if (fp=fopen(reader.txt,r)=NULL)/不存在读者文献,则输出不能还书 system (cls); printf(nnnnnnnnntt 不存在借书者!按任意键退出!); getch(); exit (0); else printf(nnnnnnttt请输入读者证号和书名:tttttt n请输入:); scanf(%d %s,&ttzhenghao,ttzname);/输入还书证号和书名 k= tjdzzs(

29、);/获取读者文献夹信息个数 for (i=0;ik;i+)/读取读者文献夹信息 fscanf(fp,%d%s%s%sn ,&tzhenghao,tmingzi,triqi,tzname); if(ttzhenghao=tzhenghao)&!strcmp(ttzname,tzname)/如果证号书名存在,则标记为1 flag=1; fclose(fp); fp=fopen(reader.txt,r);/打开读者文献 if(flag) for (i=0;inext=p1; p2=p1; p1=(struct reader*)malloc(LEN1);/新建链表 p1-zhenghao=tzhe

30、nghao;/复制证号 strcpy(p1-mingzi,tmingzi);/复制读者名字 strcpy(p1-riqi,triqi);/复制日期 strcpy(p1-zname,tzname);/复制书名 if (n=0) head=NULL; else p2-next=p1; p1-next=NULL; fclose(fp); fp=fopen(reader.txt,w);/清空读者文献 fclose(fp); fp=fopen(reader.txt,a);/追加信息 p=head; for (;p!=NULL;)/把链表内容覆盖读者文献 fprintf(fp,%d %s %s %s n,

31、p-zhenghao,p-mingzi,p-riqi,p-zname); p=p-next; free(p); fclose(fp); if(flag)/标记为1,既还书时 printf(确认还书请按回车!); for (;hitkey!=13&hitkey!=27;) hitkey=getch(); if (hitkey=13) printf(成功!按任意键返回!); n=0;flag=0; fp3=fopen(library.txt,r);/打开图书馆文献 k= tjzs();/获取图书馆文献个数 for (i=0;inext=lp1; lp2=lp1; lp1=(struct library*)malloc(LEN);/新建链表 lp1-shuhao=tshuhao;/复制书号 strcpy(lp1-name,tname);/复制书名 strcpy(lp1-author,tauthor);/复制作者 strcpy(lp1-chuban,tchuban);/复制出版社

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服