C语言仓库管理系统Word格式.docx
《C语言仓库管理系统Word格式.docx》由会员分享,可在线阅读,更多相关《C语言仓库管理系统Word格式.docx(13页珍藏版)》请在冰豆网上搜索。
出库编号、商品编号、出库商品名、出库数量、出库价格、总价
4.退货信息:
退货编号、商品编号、退还货物名、退货数量、退货价格、总价
2、2
设计要求
5.
对以上每类信息建立数据结构
6.
对以上每类信息进行插入操作
7.
对以上每类信息进行删除操作
8.
对以上每类信息进行修改操作
9.
对以上每类信息进行查找操作(查找关键字用下划线标出)
10.
数据统计;
i.
统计入库商品的总数及总价:
ii.
统计出库商品的总数及总价:
iii.
统计仓库中现有商品的总数及总价格:
#include
<
stdio.h>
string.h>
struct
product
{
char
p_num[12];
name[12];
spec[12];
int
amount;
price;
s_price;
product
*next;
};
*head;
in_product
num[12];
t_price;
in_product
*ihead;
out_product
out_product
*ohead;
quit_product
quit_product
*qhead;
init()
head=ihead=ohead=qhead=NULL;
printf("
0:
Quit\n"
);
1:
Enter
the
information
of
in
product\n"
2:
out
3:
quit
4:
Total
}
menu()
insert
data\n"
delete
modify
select
Other
to
quit\n"
menu2()
insert_product()
*
p1,*
p;
p1=(struct
*)malloc(sizeof(struct
product));
p=head;
if
(p==NULL)/*开始没有数据*/
data
Include
spbh,name,style,num,price,sale_price
scanf("
%s%s%s%d%d%d"
&
p1->
p_num,&
name,&
spec,&
amount,&
price,&
s_price);
head=p1;
head->
next=NULL;
return
0;
while(p->
next!
=NULL)/*把指针移到链表末端,在链表末端插入数据*/
p=p->
next;
p->
next=p1;
num,&
t_price);
in_insert()
in_product));
p=ihead;
rkbh,spbh,name,number,price,total_price\n"
ihead=p1;
ihead->
in_modify()
m_num[12];
num\n"
%s"
&
m_num);
(p==NULL)/*开始没有数据*/
Sorry!
No
can
be
found\n"
while(p!
=NULL)
(strcmp(p->
num,m_num)==0)
new
without
%s%s%d%d%d"
One
had
modified\n"
num
has
in_select()
s_num[12];
s_num);
num,s_num)==0)
The
you
want
is:
\n"
%s
%d
%d\n"
num,p->
p_num,p->
name,p->
amount,p->
price,p->
in_delete()
d_num[12];
d_num);
num,d_num)==0
next==NULL)/*链表只有一个数据,且是要删除的*/
ihead=NULL;
been
deleted\n"
=NULL)/*要删除的数据在链表的头上*/
ihead=ihead->
p1=p->