name,searchname) == 0)Р {Р count++;Р T = NULL;Р return;Р }Р //printf("%-10s" /> name,searchname) == 0)Р {Р count++;Р T = NULL;Р return;Р }Р //printf("%-10s" />

全文预览

数据结构家谱-管理系统

上传者:qnrdwb |  格式:doc  |  页数:17 |  大小:74KB

文档介绍
Р?}Р}Рvoid DeleteByName(BiTree &T)//删除某成员(若其还有后代,则一并删除)Р{Р?//printf("PreOrderTraverse_recursion\n");Р?if(T)Р?{Р if(strcmp(T->name,searchname) == 0)Р {Р count++;Р T = NULL;Р return;Р }Р //printf("%-10s%-10s%-10s%5d%5d%5d\n",T->name,T->birthday,T->address,T->marriage,T->live,T->sex);Р DeleteByName(T->lc);Р DeleteByName(T->rc);Р?}Р}Рvoid FixLevel(BiTree T)Р{Р if(T)Р {Р if(strcmp(T->name,searchname) == 0)Р {Р count = T->level;Р }Р FixLevel(T->lc);Р FixLevel(T->rc);Р }Р}Рvoid FixRelation(BiTree T)//输入两人姓名,确定其关系Р{Р int levo,levt;Р char levone[50],levtwo[50];Р printf("请输入第一个人的姓名\n");Р scanf("%s",searchname);Р strcpy(levone,searchname);Р FixLevel(T);Р levo = count;Р if(levo == -1)Р {Р printf("家谱无此人,请从新进入\n");Р return;Р }Р printf("请输入第二个人的姓名\n");Р scanf("%s",searchname);Р strcpy(levtwo,searchname);

收藏

分享

举报
下载此文档