城区古树名木管理系统.docx

上传人:b****4 文档编号:24663460 上传时间:2023-05-30 格式:DOCX 页数:64 大小:24.99KB
下载 相关 举报
城区古树名木管理系统.docx_第1页
第1页 / 共64页
城区古树名木管理系统.docx_第2页
第2页 / 共64页
城区古树名木管理系统.docx_第3页
第3页 / 共64页
城区古树名木管理系统.docx_第4页
第4页 / 共64页
城区古树名木管理系统.docx_第5页
第5页 / 共64页
点击查看更多>>
下载资源
资源描述

城区古树名木管理系统.docx

《城区古树名木管理系统.docx》由会员分享,可在线阅读,更多相关《城区古树名木管理系统.docx(64页珍藏版)》请在冰豆网上搜索。

城区古树名木管理系统.docx

城区古树名木管理系统

#include

#include

#include

typedefstructprotect{

charquhao[7];

charbianhao[5];

charyanghuren[20];

charriqi[11];

charcuosi[20];

charzuangkuang[20];

structprotect*prot_next;

}prot;

typedefstructgushumingmu{

charquhao[7];

charbianhao[5];

charname[20];

charxueming[20];

charkesu[20];

intshuling;

charquerensijian[11];

charbaohujibie;

charzaizididian[30];

structprotect*prot_head;

structgushumingmu*gusm_next;

}gusm;

typedefstructchengquxinxi{

charquhao[7];

charquming[20];

charbumen[30];

chardizi[30];

chardianhua[13];

charfuzeren[20];

structgushumingmu*gusm_head;

structchengquxinxi*chex_next;

}chex;

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);

voidcount_cross_list(chex*chex_head);

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");

do

{

printf("*************************************************\n"

"**1:

inputandcreatthecrosslist.**\n"

"****\n"

"**2:

savethecrosslist.**\n"

"****\n"

"**3:

loadthecrosslist.**\n"

"****\n"

"**4:

traversethecrosslist.**\n"

"****\n"

"**5:

editthecrosslist**\n"

"****\n"

"**6:

countandsortthecrosslist**\n"

"****\n"

"**7:

quitthisprogram**\n"

"*************************************************\n");

do{

printf("\n\t\tpleasemakeachoice,(1-7)\n");

ch=getchar();

fflush(stdin);

}

while(ch<'1'||ch>'7');

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);

if(ch1=='y'||ch1=='Y')

exit(-1);

}

fflush(stdin);

printf("\tContinuemakeachoice?

yesorno?

\n");

ch=getchar();

fflush(stdin);

}

while(ch=='y'||ch=='Y');

}

voidcreate_cross_list(chex**chex_head)

{

chex*hp=NULL,*p_chex;

charch;

loop:

/*******createchengqujinbenxinxi**********/

p_chex=(chex*)malloc(sizeof(chex));

printf("\tPleaseinputinformationofthearea:

\n\tzip_codearea_namedepartmentaddressphonecharman:

\n");

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);

if(ch=='y'||ch=='Y')

gotoloop;

(*chex_head)=hp;

while(p_chex!

=NULL)/********createinformationofancienttrees*******/

{

printf("\tCreate%s'sancienttrees'list?

yesorno?

\n",p_chex->quming);

ch=getchar();

fflush(stdin);

if(ch=='y'||ch=='Y')

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;

loop:

/************creategusm**************/

p_gusm=(gusm*)malloc(sizeof(gusm));

printf("\tPleaseinput%s'newancienttrees'information:

\n\tsequencenamescience_namegenericageconfirm_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);

if(ch=='y'||ch=='Y')/**************createprot**************/

gotoloop;

(*gusm_head)=hp;

while(p_gusm!

=NULL)

{

printf("\tCreate%s's%s'sprotectionhistory?

yesorno?

\n",p_gusm->zaizididian,p_gusm->name);

ch=getchar();

fflush(stdin);

if(ch=='y'||ch=='Y')

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;

loop:

/**************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);

if(ch=='y'||ch=='Y')

gotoloop;

(*prot_head)=hp;

}

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);

p_chex=p_chex->chex_next;

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");

printf("%s'sancienttrees'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;

if((out1=fopen("e:

\\chex.dat","wb"))==NULL)/******openout1*******/

{

printf("\tCan'tcreateafilltosaveinformationofarea.\n");

return(0);

}

else

printf("\tCreatefillchex.datsuccessfully!

\n");

if((out2=fopen("e:

\\gusm.dat","wb"))==NULL)/******openou2*******/

{

printf("\tCan'tcreateafilltosaveinformationofancienttrees.\n");

return(0);

}

else

printf("\tCreatefillgusm.datsuccessfully!

\n");

if((out3=fopen("e:

\\prot.dat","wb"))==NULL)/******openou3********/

{

printf("\tCan'tcreateafilltosaveinformationofprotection.\n");

return(0);

}

else

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_

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1