电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

图书信息管理系统源程序VIP免费

图书信息管理系统源程序_第1页
1/8
图书信息管理系统源程序_第2页
2/8
图书信息管理系统源程序_第3页
3/8
m_book.c#includestructnode{charname[10];intprice;charpub[15];};externstructnode*add(),*del(structnode*);externstructnode*load(),*mhdel(structnode*);/*******************************************************//*函数功能:显示菜单,选择菜单*//*输入参数:无*//*函数输出:选择的菜单序号*//*******************************************************/intmenu_select(){intcn=0;printf("**********************************************\n");printf("\t\t1.Addabook\n");printf("\t\t2.Displaybooklibrary\n");printf("\t\t3.Queryabook\n");printf("\t\t4.Deleteabook\n");printf("\t\t5.Savetodisk\n");printf("\t\t6.Loadfromdisk\n");printf("\t\t7.Mohusearch\n");printf("\t\t8.Mohudelete\n");printf("\t\t0.Exit\n");printf("\t***********************************************\n");printf("\nInput(0~8):");for(;;){scanf("%d",&cn);if(cn<0||cn>8)printf("Error!Inputagain(1~6):");elsebreak;}returncn;}voidmain(void){structnode*head=NULL;for(;;){clrscr();switch(menu_select()){case1:head=add(head);break;case2:print(head);break;case3:search(head);break;case4:head=del(head);break;case5:save(head);break;case6:head=load();break;case7:mhsearch(head);break;case8:head=mhdel(head);break;case0:exit(0);}}}s_book.c#include#include#includestructnode{charname[10];floatprice;charpub[15];structnode*link;};structnode*add(structnode*head);/*函数功能:创建结点,输入结点数据*/voidprint(structnode*head);/*函数功能:链表输出*/voidsave(structnode*head);/*函数功能:链表存储*/voidsearch(structnode*head);/*函数功能:链表结点查找*/structnode*del(structnode*head);/*函数功能:结点删除*/structnode*load(void);/*函数功能:从文件中读入数据,创建链表*/structnode*mhdel(structnode*head);/*函数功能:结点模糊删除*/voidmhsearch(structnode*head);/*函数功能:链表结点模糊查找*//*******************************************************//*函数功能:创建结点,输入结点数据*//*输入参数:链表头指针*//*函数输出:链表头指针*//*******************************************************/structnode*add(structnode*head){inti;floatjg;structnode*p,*pnew;pnew=(structnode*)malloc(sizeof(structnode));printf("Pleaseinputbookname,price,publisher\n");printf("name:");scanf("%s",pnew->name);printf("price:");scanf("%f",&jg);pnew->price=jg;printf("publisher:");scanf("%s",pnew->pub);pnew->link=NULL;if(head==NULL)return(pnew);p=head;while(p->link!=NULL)/*找到尾结点*/p=p->link;p->link=pnew;return(head);}/*******************************************************//*函数功能:链表输出*//*输入参数:链表头指针*//*函数输出:无*//*******************************************************/voidprint(structnode*head){structnode*p;p=head;printf("name\tprice\tpublisher\n");while(p!=NULL){printf("%s\t%-5.2f\t%-s\n",p->name,p->price,p->pub);p=p->link;}printf("\n\t\tPressanykeys!");getch();}/*******************************************************//*函数功能:链表存储*//*输入参数:链表头指针*//*函数输出:无*//*******************************************************/voidsave(structnode*head){FILE*fp;structnode*p;if((fp=fopen("library","wb"))==NULL){printf("Can'topenfile!\n");exit(1);}p=head;while(p!=NULL){fwrite(p,sizeof(structnode),1,fp);p=p->link;}fclose(fp);}/*******************************************************//*函数功能:从文件中读入数据,创建链表*//*输入参数:无*//*函数输出:链表头指针*//*******************************************************/structnode*load(void){FILE*...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

图书信息管理系统源程序

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部