#include #include #include #include #define MAXS 100 #define Elemtype char typedef struct BiTNode { int mark; int level; char name[50]; char birthday[50]; char address[MAXS]; Elemtype data; struct BiTNode *lc,*rc; }BiTNode,*BiTree; char nametemp[50];// 姓名char birthdaytemp[50];// 生日char addresstemp[MAXS];// 地址char ch; int leveltemp; int Nth; char searchdata[50]; char searchname[50]; int count; BiTree temp; BiTree CreateBiTree(FILE *fp); void PrintInfo(BiTree T); void PreOrderTS(BiTree T); void ShowNth(BiTree T); void SearchByName(BiTree T); void SearchByBirthday(BiTree T); void AddChild(BiTree T); void DeleteByName(BiTree T); void searchmenu(); void menu(); void insystem(); void closefile(); #include"my.h" void SearchByName(BiTree T)// 按照姓名查询,输出成员信息{ if(T) { if(T->lc) { if(T->lc->rc) { temp=T->lc->rc; while(temp) { if(strcmp(temp->name,searchname)==0) { count++; printf("\n 此人的信息为 : \n"); PrintInfo(temp); printf(" 此人父兄的信息为: \n"); PrintInfo(T); if(temp->lc->rc) { printf(" 此人孩子的信息为: \n"); temp=temp->lc->rc; while(temp) { PrintInfo(temp); temp=temp->rc; } } return; } else temp=temp->rc; } } } SearchByName(T->lc); SearchByName(T->rc); } else { printf(" 请先建立家庭关系\n"); return; } } void SearchByBirthday(BiTree T)// 按照出生日期查询成员名单{ if(T) { if(strcmp(T->birthday,searchdata)==0) { PrintInfo(T); count++; } } } void AddChild(BiTree T)// 某成员添加孩子{ if(T) { if(strcmp(T->name,searchname)==0) { count++; temp=(BiTree)malloc(sizeof(BiTNode)); printf(" 请输入添加孩子的姓名:\n"); scanf("%s",temp->name); printf(" 请输入添加孩子的出生年月:(格式形如 : 2010-1-1)\n"); scanf("%s",temp->birthday); printf(" 请输入添加孩子的家庭住址:\n"); scanf("%s",temp->address); temp->level=T->level+1; temp->rc=T->lc->rc; temp->lc=NULL; ...