![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct GLNode //定义存储中缀表达式的结点类型 { char name[100]; char prof[100]; int type; struct { struct GLNode *hp,*tp; } ptr; /*hp指向同级的下一结点,tp指向下级的首结点*/ } GList; GList *GListCreate() //建立广义表 { GList *head,*p,*q,*s,*r; //简要介绍:head指向头结点;p指向导师结点;q指向研究生结点;r指向本科生节点; s指向新建立的节点 int i,j,b; char str[100]; b=1; head=p=q=r=s=NULL; while(b) { printf("请输入人员信息"); scanf("%s",str); s =(GList *)malloc(sizeof(GList)); if(!s) printf("申请空间失败!"); for(j=0,i=0; str[i] != '-'; j++,i++) //将字符串中的学生信息转化成学生结点 s->name[j] = str[i]; s->name[j] = '