资源描述:
《销售管理系统.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include#include#include#include"conio.h"#include"process.h"#include#includestaticintMax,yue,t=0,m=0;typedefstruct{charnum[10];charname[10];floatgoods1;floatgoods2;floatgoods3;floatgoods4;floattotal;}Salesman;Salesmansal[99],hui[99];voidshuru(Salesm
2、ansal[],intn)/*输入若干条记录*/{inti=0;charsign,x[10];floatgoods1;floatgoods2;floatgoods3;floatgoods4;floattotal;while(sign!='n'&&sign!='N'){printf("输入销售员编号:");scanf("%s",sal[n+i].num);printf("输入销售员姓名:");scanf("%s",sal[n+i].name);printf("输入该销售员产品一销售量:");scanf("%f",&goods1);getchar();printf("输入该销售员产品二销
3、售量:");scanf("%f",&goods2);getchar();printf("输入该销售员产品三销售量:");scanf("%f",&goods3);getchar();printf("输入该销售员产品四销售量:");scanf("%f",&goods4);sal[n+i].goods1=goods1;sal[n+i].goods2=goods2;sal[n+i].goods3=goods3;sal[n+i].goods4=goods4;total=goods1+goods2+goods3+goods4;sal[n+i].total=total;gets(x);/*清除多余
4、的输入*/printf("是否继续输入?(Y/N):");scanf("%c",&sign);i++;}Max=i;}voidzengjia(Salesmansal[],intn)/*增加记录*/{inti=0;charsign,x[10];floatgoods1;floatgoods2;floatgoods3;floatgoods4;floattotal;while(sign!='n'&&sign!='N'){printf("输入销售员编号:");scanf("%s",sal[Max+i].num);printf("输入销售员姓名:");scanf("%s",sal[Max+i
5、].name);printf("输入该销售员产品一、二、三、四销售量:");scanf("%f%f%f%f",&goods1,&goods2,&goods3,&goods4);sal[Max+i].goods1=goods1;sal[Max+i].goods2=goods2;sal[Max+i].goods3=goods3;sal[Max+i].goods4=goods4;total=goods1+goods2+goods3+goods4;sal[Max+i].total=total;gets(x);/*清除多余的输入*/printf("是否继续输入?(Y/N):");scanf
6、("%c",&sign);i++;}Max=Max+i;}voidxiugai(Salesmansal[],intn)/*修改*/{voidshuru(Salesmansal[],intn);inti=0,choice=1;floatc,m,e,d;charx[10],xing[10],select;while(choice!=0){printf("请输入您要修改的销售员编号:");scanf("%s",x);for(i=0;;i++){if(strcmp(sal[i].num,x)==0)break;}printf("请选择您要修改的内容:");printf("------
7、----------------");printf("
8、姓名请按1
9、");printf("
10、产品一请按2
11、");printf("
12、产品二请按3
13、");printf("
14、产品三请按4
15、");printf("
16、产品四请按5
17、");printf("
18、退出请按0
19、");printf("+----------------------+");printf("请输入您的选择:");scanf("%d",&choice);switch(ch