资源描述:
《建筑工地信息管理系统》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、建筑工地信息管理系统姓名:谢程;学号:20081004513班序号:19308128#include#include#includestructbuilding{charname[20];/*工地名称*/charnum[20];/*工地号*/charcity[20];/*工地所在城市*/};structpeijian{charp_name[20];/*配件名称*/charp_num[20];/*配件号码*/charp_colour[20];/*配件颜色*/charp_weight[20];/*配件重量*/charp_
2、area[20];/*配件产地*/};structbusiness{charb_name[20];/*销售商名字*/charb_num[20];/*销售商号码*/charb_state[20];/*销售状态*/charb_city[20];/*所在城市*/};structtotal{charb_num[20];/*销售商号码*/charp_num[20];/*配件号*/charnum[20];/*工地号*/charnum2[20];/*销售商为工地提供配件数量*/};voidadd1();voidadd2();voidadd3();voidadd4();voidfind1(
3、);voidfind2();voidfind3();voidfind4();voiddel1();voiddel2();voiddel3();voiddel4();voidseek1();voidseek2();charflag='y';intn;voidadd1(){charflag='y';structbuildingbuild;FILE*fp;if((fp=fopen("c.txt","a+b"))==NULL){exit(0);}while(flag=='y'){printf("请输入建筑工地名称:");scanf("%s",build.name);printf("
4、请输入建筑工地编号:");scanf("%s",build.num);printf("请输入工地所在城市:");scanf("%s",build.city);fwrite(&build,sizeof(structbuilding),1,fp);printf("是否继续y/n:");scanf("%c",&flag);}fclose(fp);}voidadd2(){charflag='y';structpeijianpj;FILE*fp;if((fp=fopen("d.txt","a+b"))==NULL){exit(0);}while(flag=='y'){printf
5、("请输入配件名称:");scanf("%s",pj.p_name);printf("请输入配件编号:");scanf("%s",pj.p_num);printf("请输入配件颜色:");scanf("%s",pj.p_colour);printf("请输入配件重量:");scanf("%s",pj.p_weight);printf("请输入配件产地:");scanf("%s",pj.p_area);fwrite(&pj,sizeof(structpeijian),1,fp);printf("是否继续y/n:");scanf("%c",&flag);}fclose(fp
6、);}voidadd3(){charflag='y';structbusinessbus;FILE*fp;if((fp=fopen("e.txt","a+b"))==NULL){exit(0);}while(flag=='y'){printf("请输入销售商名称:");scanf("%s",bus.b_name);printf("请输入销售商编号:");scanf("%s",bus.b_num);printf("请输入销售商状态:");scanf("%s",bus.b_state);printf("请输入销售商所在城市:");scanf("%s",bus.b_city);f
7、write(&bus,sizeof(structbusiness),1,fp);printf("是否继续y/n:");scanf("%c",&flag);}fclose(fp);}voidadd4(){charflag='y';structtotalbpb;FILE*fp;if((fp=fopen("f.txt","a+b"))==NULL){exit(0);}while(flag=='y'){printf("请输入销售商号码:");scanf("%s",bpb.b_num);printf("请输入配件编号:"