城區(qū)古樹(shù)名木管理系統(tǒng)_第1頁(yè)
城區(qū)古樹(shù)名木管理系統(tǒng)_第2頁(yè)
城區(qū)古樹(shù)名木管理系統(tǒng)_第3頁(yè)
城區(qū)古樹(shù)名木管理系統(tǒng)_第4頁(yè)
城區(qū)古樹(shù)名木管理系統(tǒng)_第5頁(yè)
已閱讀5頁(yè),還剩68頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

#include<stdlib.h>#include<string.h>typedefstructprotect{charquhao[7];charbianhao[5];charyanghuren[20];charriqi[11];charcuosi[20];charzuangkuang[20];structprotect*prot_next;typedefstructgushumingmu{charquhao[7];charbianhao[5];charname[20];charxueming[20];charkesu[20];intshuling;charquerensijian[11];charbaohujibie;charzaizididian[30];structprotect*prot_head;structgushumingmu*gusm_next;typedefstructchengquxinxi{charquhao[7];charquming[20];charbumen[30];chardizi[30];chardianhua[13];charfuzeren[20];structgushumingmu*gusm_head;structchengquxinxi*chex_next;chex*chex_head;voidcreate_cross_list(chex**);voidcreate_gusm(gusm**,chex*);voidcreate_prot(prot**prot_head,gusm*p_gusm);intload_cross_list(chex**chex_head);intsave_cross_list(chex*chex_head);voidtrav_chex(void);voidtrav_gusm(gusm*);voidtrav_prot(prot*);voidtraverse_cross_list(chex*chex_head);voidedit_cross_list(void); voidmodf_chex(chex**chex_head);voidmodf_gusm(chex**p);voidmodf_prot(chex**p);voiddelt_chex(chex**p);voiddelt_gusm(chex**p);voiddelt_prot(chex**p);voidinst_chex(chex**p);voidinst_gusm(chex**p);voidinst_prot(chex**p);voidcount(void);intlevl_qcot(char*,char);intzhuk_qcot(char*,char*);intkind_qcot(char*,char*);voidone_levl_cout(void);voidone_zhuk_cout(void);voidone_kind_cout(chex*P);voidtotl_levl_cout(chex*p);voidtotl_zhuk_cout(void);voidtotl_kind_cout(chex*p);voidone_shul_cout(void);voidtotl_shul_cout(void);intshul_qcot(char*,int);main(){charch,ch1;printf("*\n"""""""""""{****************\n"**************\n"********************\n"**************\n"**************************\n"******************************\n"****************\n"***********************\n"****************\n"*******************************\n"*************************************************\n"*************************************************\n"1:inputandcreatthecrosslist.2:savethecrosslist.**\n"**\n"**\n"**\n"""""37頁(yè)腳內(nèi)容 "****\n""**4:traversethecrosslist.**\n""****\n""**5:editthecrosslist**\n""****\n""**6:countandsortthecrosslist**\n""****\n""**7:quitthisprogram**\n""*************************************************\n");printf("\n\t\tpleasemakeachoice,(1-7)\n");ch=getchar();fflush(stdin);}switch(ch){case'1':create_cross_list(&chex_head);break;case'2':save_cross_list(chex_head);break;case'3':load_cross_list(&chex_head);break;case'4':traverse_cross_list(chex_head);break;case'5':edit_cross_list();break;case'6':count();break;case'7':printf("\tareyousureyouhavesavedallthedataandquitit?\n");ch1=getchar();fflush(stdin);exit(-1);}fflush(stdin);printf("\tContinuemakeachoice?yesorno?\n");ch=getchar();fflush(stdin);}}voidcreate_cross_list(chex**chex_head){chex*hp=NULL,*p_chex;charch;/*******createchengqujinbenxinxi**********/p_chex=(chex*)malloc(sizeof(chex));printf("\tPleaseinputinformationofthearea:\n\tzip_codearea_namedepartment scanf("%s%s%s%s%s%s",p_chex->quhao,p_chex->quming,p_chex->bumen,p_chex->dizi,p_chex->dianhua,p_chex->fuzeren);fflush(stdin);p_chex->gusm_head=NULL;p_chex->chex_next=hp;hp=p_chex;printf("\tContinueinputinformationofthethearea?yesorno?\n");ch=getchar();fflush(stdin);gotoloop;while(p_chex!=NULL)/********createinformationofancienttrees*******/{printf("\tCreate%s'sancienttrees'list?yesorno?\n",p_chex->quming);ch=getchar();fflush(stdin);create_gusm(&p_chex->gusm_head,p_chex);p_chex=p_chex->chex_next;}}voidcreate_gusm(gusm**gusm_head,chex*p_chex){gusm*hp=NULL,*p_gusm;charch;/************creategusm**************/p_gusm=(gusm*)malloc(sizeof(gusm));enamesciencenamegenericageconfirm_timeprotect_levellacation:\n",p_chex->quming);scanf("%s%s%s%s%d%s%1s%s",p_gusm->bianhao,p_gusm->name,p_gusm->xueming,p_gusm->kesu,&p_gusm->shuling,p_gusm->querensijian,&p_gusm->baohujibie,p_gusm->zaizididian);fflush(stdin);strcpy(p_gusm->quhao,p_chex->quhao);p_gusm->prot_head=NULL;p_gusm->gusm_next=hp;hp=p_gusm;printf("\tContinueaddancienttreesto%s?yesorno?\n",p_chex->quming);ch=getchar();fflush(stdin); gotoloop;while(p_gusm!=NULL){printf("\tCreate%s's%s'sprotectionhistory?yesorno?\n",p_gusm->zaizididian,p_gusm->name);ch=getchar();fflush(stdin);create_prot(&p_gusm->prot_head,p_gusm);p_gusm=p_gusm->gusm_next;}}voidcreate_prot(prot**prot_head,gusm*p_gusm){prot*hp=NULL,*p_prot;charch;/**************creategushuyanghuxinxi***********/p_prot=(prot*)malloc(sizeof(prot));printf("\tPleaseinputtheinformationeofthenewprotectionhistory:\n\tguardiannurse_time(1991-03-25)measureshealth_condition\n");scanf("%s%s%s%s",p_prot->yanghuren,p_prot->riqi,p_prot->cuosi,p_prot->zuangkuang);fflush(stdin);strcpy(p_prot->quhao,p_gusm->quhao);strcpy(p_prot->bianhao,p_gusm->bianhao);p_prot->prot_next=hp;hp=p_prot;printf("\tContinueinputthis%s'protectionhistory?yesorno?\n",p_gusm->name);ch=getchar();fflush(stdin);gotoloop;}voidtrav_chex(void){chex*p_chex=chex_head;printf("******************************************************************************\n");while(p_chex){printf("\t%-7s%-11s%-17s%-14s%-12s%-6s\n",p_chex->quhao,p_chex->quming,p_chex->bumen,p_chex->dizi,p_chex->dianhua,p_chex->fuzeren);printf("______________________________________________________________________________\n");}}voidtrav_gusm(gusm*p_gusm){printf("______________________________________________________________________________\n");while(p_gusm){printf("\t%-12s%-20s%-20s%-15s\n\t\t%-8d%-15s%-5c%s\n",p_gusm->bianhao,p_gusm->name,p_gusm->xueming,p_gusm->kesu,p_gusm->shuling,p_gusm->querensijian,p_gusm->baohujibie,p_gusm->zaizididian);p_gusm=p_gusm->gusm_next;printf("______________________________________________________________________________\n");}}voidtrav_prot(prot*p_prot){printf("______________________________________________________________________________\n");while(p_prot){printf("\t%-8s%-7s%-11s%-14s%-15s%-15s\n",p_prot->quhao,p_prot->bianhao,p_prot->yanghuren,p_prot->riqi,p_prot->cuosi,p_prot->zuangkuang);p_prot=p_prot->prot_next;printf("------------------------------------------------------------------------------\n");}}voidtraverse_cross_list(chex*chex_head){chex*p_chex=chex_head;gusm*p_gusm=NULL;prot*p_prot=NULL;printf("******************************************************************************\n");while(p_chex!=NULL)/*************printoutchengquxinxi***********/{printf("theinformationortheareais:\n%-10s%-15s%-15s%-12s%-15s%-18s\n",p_chex->quhao,p_chex->quming,p_chex->bumen,p_chex->dizi,p_chex->dianhua,p_chex->fuzeren);p_gusm=p_chex->gusm_head;while(p_gusm!=NULL)/*********printfoutinformationofancienttrees*******/{printf("------------------------------------------------------------------------------\n"); information:\n%-10s%-10s%-20s%-20s%-15s\n\t%-10d%-20s%-20c%-30s\n",p_chex->quming,p_gusm->quhao,p_gusm->bianhao,p_gusm->name,p_gusm->xueming,p_gusm->kesu,p_gusm->shuling,p_gusm->querensijian,p_gusm->baohujibie,p_gusm->zaizididian);p_prot=p_gusm->prot_head;while(p_prot!=NULL)/*********printfoutgushumingmuyanghuxinxi*****/{printf("______________________________________________________________________________\n");printf("theprotectionhistoryofthisancienttree:\n%-8s%-7s%-15s%-12s%-15s%-15s\n",p_prot->quhao,p_prot->bianhao,p_prot->yanghuren,p_prot->riqi,p_prot->cuosi,p_prot->zuangkuang);p_prot=p_prot->prot_next;}p_gusm=p_gusm->gusm_next;}printf("******************************************************************************\n");p_chex=p_chex->chex_next;}}intsave_cross_list(chex*chex_head){FILE*out1,*out2,*out3;chex*p_chex=chex_head;gusm*p_gusm=NULL;prot*p_prot=NULL;/******openif((out1=fopen("e:\\chex.dat","wb"))==/******openout1*******/{printf("\tCan'tcreateafilltosaveinformationofarea.\n");return(0);}printf("\tCreatefillchex.datsuccessfully!\n");if((out2=fopen("e:\\gusm.dat","wb"))==NULL)ou2*******/{printf("\tCan'tcreateafilltosaveinformationofancienttrees.\n");return(0);}printf("\tCreatefillgusm.datsuccessfully!\n");if((out3=fopen("e:\\prot.dat","wb"))==NULL)ou3********//******open/******open printf("\tCan'tcreateafilltosaveinformationofprotection.\n");return(0);}printf("\tCreatefillprot.datsuccessfully!\n");while(p_chex!=NULL)/*******savein********/{fwrite(p_chex,sizeof(chex),1,out1);p_gusm=p_chex->gusm_head;while(p_gusm!=NULL){fwrite(p_gusm,sizeof(gusm),1,out2);p_prot=p_gusm->prot_head;while(p_prot!=NULL){fwrite(p_prot,sizeof(prot),1,out3);p_prot=p_prot->prot_next;}p_gusm=p_gusm->gusm_next;}p_chex=p_chex->chex_next;}fclose(out1);fclose(out2);fclose(out3);printf("\tcongrantulations!successfullysaved!\n");return(-1);}intload_cross_list(chex**chex_head){FILE*in1,*in2,*in3;chex*hp_chex=NULL,*p_chex;gusm*hp_gusm=NULL,*p_gusm;prot*p_prot;if((in1=fopen("e:\\chex.dat","rb"))==NULL)/***********openin1*********/{printf("\tFailtoopenfillchex.dat.\n\tpressanykeytocomeback.\n");getchar();return(0);}printf("\topenfillchex.datsuccessfully!\n");if((in2=fopen("e:\\gusm.dat","rb"))==NULL)/***********openin2*********/ printf("\tFailtopenfillgusm.dat.\n\tpressanykeytocomeback\n");getchar();return(0);}printf("\topenfillgusm.datsuccessfully!\n");if((in3=fopen("e:\\prot.dat","rb"))==NULL)/***********openin3********/{printf("\tFailtoopenfillprot.dat.\n\tpressanykeytocameback\n");getchar();return(0);}printf("\topenfillprot.datsuccessfully!\n");while(!feof(in1))/***********loadchex********/{p_chex=(chex*)malloc(sizeof(chex));fread(p_chex,sizeof(chex),1,in1);if(!feof(in1)){p_chex->gusm_head=NULL;p_chex->chex_next=hp_chex;hp_chex=p_chex;}}adhpchexwhile(!feof(in2)){/**********loadgusm********/p_gusm=(gusm*)malloc(sizeof(gusm));fread(p_gusm,sizeof(gusm),1,in2);if(!feof(in2)){p_chex=(*chex_head);while(p_chex!=NULL){if(!strcmp(p_chex->quhao,p_gusm->quhao)){p_gusm->prot_head=NULL;p_gusm->gusm_next=p_chex->gusm_head;p_chex->gusm_head=p_gusm;break;}p_chex=p_chex->chex_next; }}while(!feof(in3))/***********loadprot*********/{p_prot=(prot*)malloc(sizeof(prot));fread(p_prot,sizeof(prot),1,in3);if(!feof(in3)){p_chex=(*chex_head);while(p_chex!=NULL){if(!strcmp(p_chex->quhao,p_prot->quhao)){p_gusm=p_chex->gusm_head;while(p_gusm!=NULL){if(!strcmp(p_gusm->bianhao,p_prot->bianhao)){p_prot->prot_next=p_gusm->prot_head;p_gusm->prot_head=p_prot;break;}p_gusm=p_gusm->gusm_next;}break;}p_chex=p_chex->chex_next;}}}fclose(in1);fclose(in2);fclose(in3);printf("\tloadsucced!\n");return1;}voidedit_cross_list(void){charch;printf("\t\t1:modify\n""\t\t2:delete\n"37頁(yè)腳內(nèi)容 printf("\tpleasemakeachoice:\n");ch=getchar();fflush(stdin);}switch(ch){case'1':{printf("\t\t1:modifyinformationofarea.\n""\t\t2:modifyinformationofancienttrees.\n""\t\t3:modifyinformationofprotection.\n");printf("\tpleasemakeachoice:\n");ch=getchar();fflush(stdin);}switch(ch){case'1':modf_chex(&chex_head);break;case'2':modf_gusm(&chex_head);break;case'3':modf_prot(&chex_head);break;}printf("\tlifftbackuponeleveltothepreviousmenu,yesorno?\n");ch=getchar();fflush(stdin);break;case'2':printf("\t\t1:deleteinformationofarea.\n""\t\t2:deleteinformationofancienttree.\n""\t\t3:deleteinformationofprotection.\n");printf("\tpleasemakeachoice:\n");ch=getchar();fflush(stdin);}switch(ch){case'1':delt_chex(&chex_head);break; case'3':delt_prot(&chex_head);break;}printf("\tlifftbackuponeleveltothepreviousmenu,yesorno?\n");ch=getchar();fflush(stdin);break;case'3':printf("\t\t1:insertinformationofarea.\n""\t\t2:insertinformationofancienttrees.\n""\t\t3:insertinformationofprotection.\n");printf("\tpleasemakeachoice:\n");ch=getchar();fflush(stdin);}switch(ch){case'1':inst_chex(&chex_head);break;case'2':inst_gusm(&chex_head);break;case'3':inst_prot(&chex_head);break;}printf("\tlifftbackuponeleveltothepreviousmenu,yesorno?\n");ch=getchar();fflush(stdin);}}voidmodf_chex(chex**chex_head){chex*p_chex=NULL;chara[20],ch;p_chex=*chex_head;printf("\tthearealistis:\n");trav_chex();printf("\tPleaseinputthearea'nameyouwanttomodify.\n");scanf("%s",a);fflush(stdin);while(p_chex){if(!strcmp(p_chex->quming,a))break;p_chex=p_chex->chex_next; ifp_chex){printf("\tYou'veinputanwrongarea'name.\n");gotoloop;}{printf("\t1:%-20s2:%-20s3:%-20s\n\t4:%-20s5:%-20s6:%-20s\n",p_chex->quhao,p_chex->quming,p_chex->bumen,p_chex->dizi,p_chex->dianhua,p_chex->fuzeren);printf("\tpleasechoicethecodenumberyouwanttomodify.\n");ch=getchar();fflush(stdin);printf("\tpleaseinputthenewdata.\n");switch(ch){case'1':scanf("%s",p_chex->quhao);break;case'2':scanf("%s",p_chex->quming);break;case'3':scanf("%s",p_chex->bumen);break;case'4':scanf("%s",p_chex->dizi);break;case'5':scanf("%s",p_chex->dianhua);break;case'6':scanf("%s",p_chex->fuzeren);break;}fflush(stdin);printf("\tpress1tocontinuemodifythisarea'sjibenxinxi.\n""\tpress2tomodifyothearea'sjibenxinxi.\n""\tpressanyotherkeytobacktogoon.\n");ch=getchar();fflush(stdin);switch(ch){case'1':gotolop;break;case'2':gotoloop;break;}}voidmodf_gusm(chex**chex_head){chex*p_chex=NULL;gusm*p_gusm=NULL;chara[20],b[30],ch;printf("\tarealistis:\n");trav_chex();printf("\tPleaseinputthearea'namewheretheancienttreeyouwanttomodifyis.\n");scanf("%s",a);fflush(stdin);while(p_chex){if(!strcmp(p_chex->quming,a))break;p_chex=p_chex->chex_next;}/***while(strcmp(p_chex->quming,a)&&(p_chex))此為改前錯(cuò)誤循環(huán),p_chex=p_chex->chex_next;此種循環(huán)有問(wèn)題,若輸錯(cuò)會(huì)卡死另外書(shū)上沒(méi)有(p_chex)這個(gè)判斷條件,不懂是什么原理***************/ifp_chex){printf("\tYou'veinputanwrongarea'name.\n");gotoloop;}p_gusm=p_chex->gusm_head;printf("\tthisarea'sancienttreelistis:\n");trav_gusm(p_gusm);printf("\tpleaseinputthelocationofthetreeyouwanttomodify.\n");scanf("%s",b);fflush(stdin);while(p_gusm){if(!strcmp(p_gusm->zaizididian,b))break;p_gusm=p_gusm->gusm_next;}/***while(strcmp(p_gusm->bianhao,b)&&p_gusm)p_gusm=p_gusm->gusm_next;*********/ifpgusm){printf("\tYou'veinputanwronglocation.\n");gotolop;}{printf("\t1:%-10s2:%-20s3:%-20s4:%-15s\n\t5:%-10d6:%-20s7:%-20c8:%-20s\n",p_gusm->bianhao,p_gusm->name,p_gusm->xueming,p_gusm->kesu,p_gusm->shuling,p_gusm->querensijian,p_gusm->baohujibie,p_gusm->zaizididian);37頁(yè)腳內(nèi)容 printf("\tpleasechoicethecodenumberyouwanttomodify.\n");ch=getchar();fflush(stdin);printf("\tpleaseinputthenewdata.\n");switch(ch){case'1':scanf("%s",p_gusm->bianhao);break;case'2':scanf("%s",p_gusm->name);break;case'3':scanf("%s",p_gusm->xueming);break;case'4':scanf("%s",p_gusm->kesu);break;case'5':scanf("%d",&p_gusm->shuling);break;case'6':scanf("%s",p_gusm->querensijian);break;case'7':scanf("%c",&p_gusm->baohujibie);break;case'8':scanf("%s",p_gusm->zaizididian);break;}fflush(stdin);printf("\t1:continuemodifythisancienttree'sinformation.\n""\t2:continuemodifythisarea'sotherancienttree'sinformation.\n""\t3:continuemodifyothearea'sancienttree'sinformation.\n""\tanyotherkeytogoon.\n");ch=getchar();fflush(stdin);switch(ch){case'1':gotolop1;break;case'2':gotolop;break;case'3':gotoloop;break;}}voidmodf_prot(chex**chex_head){chex*p_chex=*chex_head;gusm*p_gusm=NULL;prot*p_prot=NULL;chara[20],b[5],c[11],ch;p_chex=*chex_head;printf("\tarealistis:\n");trav_chex();printf("\tpleaseinputthearea'nameyouwanttomodify.\n"); 網(wǎng)巡查制度scanf("%s",a);fflush(stdin);while(p_chex){if(!strcmp(p_chex->quming,a))break;p_chex=p_chex->chex_next;}/***while(strcmp(p_chex->quming,a))p_chex=p_chex->chex_next;ifpchex)**********/{printf("\tYou'veinputanwrongarea'name.\n");gotolop1;}p_gusm=p_chex->gusm_head;printf("\ttheinformationoftheancienttreesinthisareais:\n");trav_gusm(p_gusm);printf("\tpleaseinputthesequenceofthetreeyouwanttomodify.\n");scanf("%s",b);fflush(stdin);while(p_gusm){if(!strcmp(p_gusm->bianhao,b))break;p_gusm=p_gusm->gusm_next;}/***while(strcmp(p_gusm->bianhao,b))p_gusm=p_gusm->gusm_next;*******/ifpgusm){printf("\tYou'veinputanwrongsequence.\n");gotolop2;}p_prot=p_gusm->prot_head;printf("thisancienttree'sprotectionhistorylist:\n");trav_prot(p_prot);printf("\tpleaseinputthenursetimeoftheprotectionwhitchyouwanttomodify.\n");scanf("%s",c);fflush(stdin);while(p_prot){if(!strcmp(p_prot->riqi,c))break;p_prot=p_prot->prot_next;}/****while(strcmp(p_prot->riqi,c))37頁(yè)腳內(nèi)容ifpprot{printf("\tYou'veinputanwrongnursetime");gotolop3;}{printf("\t1:%-15s2:%-15s3:%-20s4:%-20s\n",p_prot->yanghuren,p_prot->riqi,p_prot->cuosi,p_prot->zuangkuang);printf("\tpleasechoicethecodenumberyouwanttomodify.\n");ch=getchar();fflush(stdin);printf("\tpleaseinputthenewdata.\n");switch(ch){case'1':scanf("%s",p_prot->yanghuren);break;case'2':scanf("%s",p_prot->riqi);break;case'3':scanf("%s",p_prot->cuosi);break;case'4':scanf("%s",p_prot->zuangkuang);break;}fflush(stdin);printf("\t1:continuemodifythisprotectionhistory'sinformation.\n""\t2:continuemodifythisancienttree'sotherprotectionhistory.\n""\t3:continuemodifythisarea'sotherancienttree'sprotectionhistory.\n""\t4:continuemodifyotherarea'sancienttree'sprotectioninformation\n""\tpressanyotherkeytogoon.\n");ch=getchar();fflush(stdin);switch(ch){case'1':gotolop4;break;case'2':gotolop3;break;case'3':gotolop2;break;case'4':gotolop1;break;}}voiddelt_chex(chex**chex_head){chara[20],ch;p=p_chex=*chex_head;printf("\tthearealistis:\n");trav_chex();printf("\tpleaseinputthearea'nameyouwanttodelete.\n");scanf("%s",a);fflush(stdin);while(p_chex){if(!strcmp(p_chex->quming,a))break;p=p_chex;p_chex=p_chex->chex_next;}}while(strcmp(p_chex->quming,a)){}p=p_chex;p_chex=p_chex->chex_next;ifp_chex){printf("\tYou'veinputanwrongarea'name.\n");gotoloop;}if(p_chex==*chex_head)*chex_head=p_chex->chex_next;p->chex_next=p_chex->chex_next;free(p_chex);printf("\tcontinuedeleteotherarea?yesorno?\n");ch=getchar();fflush(stdin);gotoloop;voiddelt_gusm(chex**chex_head){chex*p_chex=NULL;gusm*p_gusm=NULL,*p=NULL;chara[20],b[30],ch;p_chex=*chex_head;printf("\tthearealistis:\n");trav_chex();printf("\tpleaseinputthearea'namewheretheancienttreebelongsto.\n"); 網(wǎng)巡查制度scanf("%s",a);fflush(stdin);while(p_chex){if(!strcmp(p_chex->quming,a))break;p_chex=p_chex->chex_next;}/***while(strcmp(p_chex->quming,a))/p_chex=p_chex->chex_next/ifp_chex){printf("\tYou'veinputanwrongarea'name.\n");gotoloop;}p=p_gusm=p_chex->gusm_head;printf("theancienttreelistinthisareais:\n");trav_gusm(p_gusm);printf("\tpleaseinputthelocationoftheancienttree.\n");scanf("%s",b);fflush(stdin);while(p_gusm){if(!strcmp(p_gusm->zaizididian,b))break;p=p_gusm;p_gusm=p_gusm->gusm_next;}while(strcmp(p_gusm->bianhao,b{p=p_gusm;p_gusm=p_gusm->gusm_next;}*/ifpgusm){printf("\tYou'veinputanwronglocation.\n");gotolop;}if(p_gusm==p_chex->gusm_head)p_chex->gusm_head=p_gusm->gusm_next;p->gusm_next=p_gusm->gusm_next;free(p_gusm);printf("\t1:continuedeletthisarea'sancienttree.\n""\t2:continuemodifyothearea'sancienttree.\n""\tpressanyotherkeytogoon.\n");ch=getchar(); switch(ch){case'1':gotolop;break;case'2':gotoloop;break;}}voiddelt_prot(chex**chex_head){chex*p_chex=*chex_head;gusm*p_gusm=NULL;prot*p_prot=NULL,*p=NULL;chara[20],b[5],c[11],ch;p_chex=*chex_head;printf("\tthearealistis:\n");trav_chex();printf("\tpleaseinputthearea'snamewheretheancienttreeis.\n");scanf("%s",a);fflush(stdin);while(p_chex){if(!strcmp(p_chex->quming,a))break;p_chex=p_chex->chex_next;}while(strcmp(p_chex->quming,a))p_chex=p_chex->chex_next;ifp_chex){printf("\tYou'veinputanwrongarea_name.\n");gotoloop1;}p_gusm=p_chex->gusm_head;printf("\ttheancienttreelistinthisareais:\n");trav_gusm(p_gusm);printf("\tpleaseinputthesequenceoftheancienttree.\n");scanf("%s",b);fflush(stdin);while(p_gusm){if(strcmp(p_gusm->bianhao,b))break;p_gusm=p_gusm->gusm_next;}p_gusm=p_gusm->gusm_next;*/ifpgusm){printf("\tYou'veinputanwrongsequence.\n");gotoloop2;}p=p_prot=p_gusm->prot_head;{printf("sorry,there'snoprotectionhistoryofthisacienttree.");gotoloop4;}printf("\ttheprotectionlistoftheancienttreeis:\n");trav_prot(p);printf("\tpleaseinputthenursetimeofthetreewhichyouwanttodelete.\n");scanf("%s",c);fflush(stdin);while(p_prot){if(strcmp(p_prot->riqi,c))break;p=p_prot;p_prot=p_prot->prot_next;}while(strcmp(p_prot->riqi,c{}p=p_prot;p_prot=p_prot->prot_next;ifpprot){printf("\tYou'veinputanwrongnursetime.\n");gotoloop3;}if(p_prot==p_gusm->prot_head)p_gusm->prot_head=p_prot->prot_next;p->prot_next=p_prot->prot_next;free(p_prot);printf("\t1:continuedeletthisarea,thistree,thisnurse_time'sinformation.\n""\t2:continuedeletthisarea,thisancienttree'sotherprotectiondata.\n""\t3:continuedeletotherarea'sancienttree'sprotectiondata.\n""\tpressanyotherkeytogoon.\n");ch=getchar();37頁(yè)腳內(nèi)容 switch(ch){case'1':gotoloop3;break;case'2':gotoloop2;break;case'3':gotoloop1;break;}}voidinst_chex(chex**chex_head){chex*p=NULL;charch;p=(chex*)malloc(sizeof(chex));printf("\tthecurrentareainformationlistis:\n");trav_chex();printf("\tpleaseinputinformationofarea:\n\tzip_code\tarea_name\tdepartment\taddress\tphone\tcharman\n");scanf("%s%s%s%s%s%s",p->quhao,p->quming,p->bumen,p->dizi,p->dianhua,p->fuzeren);p->gusm_head=NULL;fflush(stdin);printf("\tcreatethisarea'santienttreelist?yesorno?\n");ch=getchar();fflush(stdin);create_gusm(&p->gusm_head,p);/*while(p_chex){hp=p_chex;p_chex=p_chex->chex_next;}/*while(p_chex->chex_next)p_chex=p_chex->chex_next;*hp_chex->chex_next=p;*/p->chex_next=*chex_head;*chex_head=p;printf("\tcontinueinsertinformationofarea?yesorno?\n");ch=getchar();fflush(stdin);gotolop;} 榆橫供水公司管網(wǎng)巡查制度voidinst_gusm(chex**chex_head){chex*p_chex=NULL;gusm*p_gusm=NULL,*p=NULL;charch;p=(gusm*)malloc(sizeof(gusm));p_chex=*chex_head;printf("\tthearealistis:\n");trav_chex();printf("\tpleaseinputthezip_codewhereyouwanttoinsertnewtreein:\n");scanf("%s",p->quhao);fflush(stdin);while(p_chex){if(!strcmp(p_chex->quhao,p->quhao))break;p_chex=p_chex->chex_next;}/*while(p_chex->quhao!=p->quhao)p_chex=p_chex->chex_next;ifp_chex){printf("\tyou'veinputanwrongzip_code.\n");gotoloop1;}p_gusm=p_chex->gusm_head;printf("\tthecurrentancienttrees'listofthisareais:\n");trav_gusm(p_gusm);printf("\tpleaseinputthedataofthenewancienttreewhichyouwanttoinsertin\n""\tsequencenameconfirm_timescience_nameprotection_levelgenericage\n"location\n");scanf("%s%s%s%s%d%s%1s%s",p->bianhao,p->name,p->xueming,p->kesu,&p->shuling,p->querensijian,&p->baohujibie,p->zaizididian);fflush(stdin);p->prot_head=NULL;printf("\tcreatethisancienttree'sprotectioninformation?yesorno?\n");ch=getchar();fflush(stdin);create_prot(&p->prot_head,p);p->gusm_next=p_chex->gusm_head;p_chex->gusm_head=p;/*while(p_gusm->gusm_next)p_gusm=p_gusm->gusm_next;p_gusm->gusm_next=p;*/ "\tpress2toinsertancienttreetootherarea.\n""\tpressanyotherkeytogobacktomainmenu.\n");ch=getchar();fflush(stdin);switch(ch){case'1':gotoloop2;case'2':gotoloop1;}}voidinst_prot(chex**chex_head){chex*p_chex=NULL;gusm*p_gusm=NULL;prot*p_prot=NULL,*p=NULL;charch;p=(prot*)malloc(sizeof(prot));p_chex=*chex_head;printf("\tthearealistis:\n");trav_chex();printf("\tpleaseinputthezip_codewhereyouwanttoinsertnewdatain:\n");scanf("%s",p->quhao);fflush(stdin);while(p_chex){if(!strcmp(p_chex->quhao,p->quhao))break;p_chex=p_chex->chex_next;}/*while(p_chex->quhao!=p->quhao)p_chex=p_chex->chex_next;*/if!p_chex){printf("\tyou'veinputanwrongzipcode.\n");gotoloop1;}p_gusm=p_chex->gusm_head;printf("\tthisarea'sancienttreelistis:\n");trav_gusm(p_gusm);printf("\tpleaseinputthesequenceyouwanttoinsertinnewprotection:\n");scanf("%s",p->bianhao);fflush(stdin); {if(!strcmp(p_gusm->bianhao,p->bianhao))break;p_gusm=p_gusm->gusm_next;}/*while(p_gusm->bianhao!=p->bianhao)p_gusm=p_gusm->gusm_next;*/ifpgusm){printf("\tyou'veinputanwrongsequence.\n");gotoloop2;}p_prot=p_gusm->prot_head;printf("\tthecurrentprotectionhistoryofthisancienttreeis:\n");trav_prot(p_prot);printf("\tpleaseinputnewprotectionofthistree:\n\tguadian\nurse_time\tmeasure\thealth_condition\n");scanf("%s%s%s%s",p->yanghuren,p->riqi,p->cuosi,p->zuangkuang);fflush(stdin);/*while(p_prot->prot_next)p_prot=p_prot->prot_next;p_prot->prot_next=p;*///p->prot_next=p_prot;//p_prot=p;*******對(duì)指針的理解還是不到位,此為改前錯(cuò)誤,操作后并故改為下兩mp->prot_next=p_gusm->prot_head;p_gusm->prot_head=p;printf("\tpress1tocontinueinsertnewprotectiontothistree.\n""\tpress2toinsertthisarea'sotherancienttree'sprotection.\n""\tpress3toinsertotherarea'sancienttree'sprotection.\n""\tpressanyotherkeytobacktomainmenu.\n");ch=getchar();fflush(stdin);switch(ch){case'1':gotoloop3;break;case'2':gotoloop2;break;case'3':gotoloop1;break;}}voidcount(void)37頁(yè)腳內(nèi)容 charch;{printf("\t1:countoneplace'sancienttreeandsortorder.\n""\t2:counteverywhere'sancienttreeandsortorder.\n");ch=getchar();fflush(stdin);switch(ch){case'1':{{thetotalnumber.\n""\t2:countoneplace'sancienttreewhoselastconditionare\n\t\t\"binglingsiwang\"or\"shengzhangsuairuo\".\n""\t3:conutoneplace'sanykindofancienttree'snumber.\n""\t4:countoneplace'sanyagestepofancienttree\n");printf("\tpleasemakeachoice:\n");ch=getchar();fflush(stdin);switch(ch){case'1':one_levl_cout();break;case'2':one_zhuk_cout();break;case'3':one_kind_cout(chex_head);break;case'

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論