下载此文档

数据结构课程设计公司管理系统.doc


文档分类:办公文档 | 页数:约21页 举报非法文档有奖
1/21
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/21 下载此文档
文档列表 文档介绍
#include<>#include<>#include<>//顾客链表,用于存放顾客名字、电话和该顾客所有订单typedefstructCustomerList{charname[15],tel[15];charID[15];intproduce_num;structCustomerList*next;//structIndentList*Indent;}Customer,*PCustomer;//产品链表,用于存放产品信息typedefstructProduceList{charname[15];intprice;intnum;structProduceList*next;structCustomerList*Customer;structSupplierList*Supplier;}Produce,*PProduce;//供应商链表,用于存放供应商信息以及该供应商所供应的订单信息typedefstructSupplierList{charname[15],tel[15];charID[15];intproduce_num;structSupplierList*next;//structIndentList*Indent;}Supplier,*PSupplier;//订单链表,用于存放订单信息,该订单的顾客、产品及供应商typedefstructIndentList{charnumber[15];structProduceListproduce;structCustomerListCustomer;//一个订单顾客只有一个structSupplierListSupplier;//供应商也只有一个structIndentList*next;}Indent,*PIndent;//头节点CustomerCustomerhead;ProduceProducehead;SupplierSupplierhead;IndentIndenthead;//头指针structCustomerList*p_Customerhead=&Customerhead;structProduceList*p_Producehead=&Producehead;structSupplierList*p_Supplierhead=&Supplierhead;structIndentList*p_Indenthead=&Indenthead;/*******************************************************************************************///在顾客链表尾部添加数据voidCustomer_append(){intflag=1;PCustomernewCustomer=(PCustomer)malloc(sizeof(Customer));printf("请输入要添加的顾客信息\n");printf("姓名:");scanf("%s",newCustomer->name);//printf("%s\n",newCustomer->name);printf("电话:");scanf("%s",newCustomer->tel);//printf("%s\n",newCustomer->tel);printf("ID:");scanf("%s",newCustomer->ID);//printf("%s\n",newCustomer->ID);newCustomer->next=NULL;newCustomer->produce_num=0;//newCustomer->Indent=NULL;//查找最后一个节点PCustomertmp=p_Customerhead;while(tmp->next){tmp=tmp->next;if(strcmp(tmp->ID,newCustomer->ID)==0) {flag=0;free(newCustomer);break; }}if(flag){tmp->next=newCustomer;printf("添加完成\n");}else{printf("已存在该客户信息\n");}}//在顾客链表中查找顾客intCustomer_find(char*ID,PCustomerCustomer){intpos=1;PCustomertmp=p_Customerhead;while(tmp=tmp->next){if(strcmp(tmp->ID,ID)==0){strcpy(Customer->name,tmp->name);strcpy(Customer->tel,tmp->tel);retur

数据结构课程设计公司管理系统 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数21
  • 收藏数0 收藏
  • 顶次数0
  • 上传人qiang19840906
  • 文件大小84 KB
  • 时间2020-08-07