《选课信息管理--录入》由会员分享,可在线阅读,更多相关《选课信息管理--录入(2页珍藏版)》请在金锄头文库上搜索。
1、#include #include int N1,N2,kk1,kk2,kk3; struct couse * head1; struct student * head2; struct couse/课程信息结构体 int num1; char name1; int score; int nelepeo;/课程已选人数 int Melepeo;/课程人数上限 struct couse * next; ; struct student/学生信息结构体 int num2; char name2; int nelenum;/已选课程编号 int nelen;/已选课程数量 struct studen
2、t * next; ; void Ms() for(kk1=0;kk1num1,p1-name1,head1=NULL; while(!feof(fp) N1=N1+1; if(N1=1)head1=p1; else p2-next=p1; p2=p1; p1=(struct couse * )malloc(sizeof(struct couse); fscanf(fp,“%d%s%d%d%d“, p2-next=NULL; void inputc()/录入课程主函数 int i; printf(“ttt 录入课程信息n“); printf(“1.从文件录入n“); printf(“2.返回主菜单n“); printf(“请选择(12):n“); scanf(“%d“, switch(i) case(1):filec();break; case(2):break;