简单的商品库存管理程序 c语言(simple commodity inventory management procedures, c language)

简单的商品库存管理程序 c语言(simple commodity inventory management procedures, c language)

ID:11835532

大小:29.50 KB

页数:11页

时间:2018-07-14

简单的商品库存管理程序 c语言(simple commodity inventory management procedures, c language)_第1页
简单的商品库存管理程序 c语言(simple commodity inventory management procedures, c language)_第2页
简单的商品库存管理程序 c语言(simple commodity inventory management procedures, c language)_第3页
简单的商品库存管理程序 c语言(simple commodity inventory management procedures, c language)_第4页
简单的商品库存管理程序 c语言(simple commodity inventory management procedures, c language)_第5页
资源描述:

《简单的商品库存管理程序 c语言(simple commodity inventory management procedures, c language)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、简单的商品库存管理程序c语言(Simplecommodityinventorymanagementprocedures,Clanguage)#includesstdio.h><#includesmalloc.h><#definelensizeof(structgoods)structgoods{longnumber.charname[20];intcount;structgoods*next;};structgoods*creat(structgoods*head);structgoods*destory(structgoods*head);structgoods*se

2、ll(longnumber,intcount,structgoods*head);structgoods*stock(longnumber,intcount,structgoods*head);voidlist(structgoods*head);structgoods*(structgoods*p1,structgoods*head);voidmain(){structgoods*head=null;longnumber.intcount,choose;igive{printf("1.shurusangpinxinxi2.xiaoshou3.chaozhao

3、n4.youjusangpinxinxi5.qinchuhis,yousangpin6.exit");printf("inputchoose:");scanf("%d"&choose).if(choose==1)head=creat(head);elseif(choose==2){printf("inputnumberandcount:");scanf("%7d%d"&number&count).head=sell(number,count,head).}elseif(choose==3){printf("inputnumberandcount:

4、");scanf("%7d%d"&number&count).head=stock(number,count,head).}elseif(choose==4)list(head);elseif(choose==5)head=destory(head);}while(ichoose!=6);}structgoods*creat(structgoods*head1){structgoods*head=null,*p1*p2;intn=0;if(head1)destory(head1);p2=p1=(structgoods*)malloc(len);printf("inp

5、utnumber&name:");scanf("%7d%s&p2->number,p2->name);p2->count=0;while(p2->number){if(n==0)head=p1.elsep1->next=p2.p1=p2.p2=(structgoods*)malloc(len);printf("inputnumber&name:");scanf("%7d%s&p2->number,p2->name);p2->count=0;n++;}p1->next=null;returnhead;}structgoods*destory(structgoods

6、*head){charword;structgoods*p1*p2;p1=p2=head;igive{getchar();printf("doyoureallywanttodestorythegoodssystemy/n?);scanf("%c",&word);}(单词)!=Y&字!=n);如果(字==Y){如果(P1)做{P2=P1;下一步;免费((无效*)P2);}(P1);printf(“货物系统被摧毁!“n);返回null;}elseprintf(“手术破坏已取消”);返回头;}货物销售结构(长整数、整数、结构、货物、头){结构*;如果(头=NULL){

7、printf(“错误!系统是空的!“n);系统(暂停);返回null;}对于(P1=头;P1!=NULL;如果(P1=数字=数字)中断;如果(P1){如果(P1=计数<计数){printf(“数量太少!“n);返回头;}否则,P1=计数=计数;}elseprintf(“错误!找不到LD的名称“N”、“数字”;对于(P1=头;P1!=NULL;如果(P1=计数=0)头=del(P1,头);返回头;}货物(长号,整数,货物结构,头){结构*;对于(P1=头;P1;P1=下)如果(P1=数字=数字){计数=+计数;打破;}如果(P1=NULL)

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。