#include #include struct couse * head1; struct student * head2; struct couse// 课程信息结构体{ int num1; char name1[20]; int score; int nelepeo;// 课程已选人数 int Melepeo;// 课程人数上限 struct couse * next; }; struct student// 学生信息结构体{ int num2; char name2[20]; int nelenum[50];// 已选课程编号 int nelen;// 已选课程数量 struct student * next; }; void keyboardc()// 录入课程子函数( 从键盘录入 )
{ struct couse *p1,*p2; N1=0; p1=p2=(struct couse*)malloc(sizeof(struct couse)); printf("\n课程编号 \t课程名称 \t学分 \t课程人数上限\n"); scanf("%d%s%d%d",&p1->num1,p1->name1,&p1->score,&p1->Melepeo); p1->nelepeo=0; head1=NULL; while(p1->num1
=0&&p1->num1
='#') { N1=N1+1; if(N1==1)head1=p1; else p2->next=p1; p2=p1; p1=(struct couse * )malloc(sizeof(struct couse)); scanf("%d%s%d%d",&p1->num1,p1->name1,&p1->score,&p1->Melepeo); p1->nelepeo=0;