3、o.h>#includeintN1,N2,kk1,kk2,kk3;structcouse*head1;structstudent*head2;structcouse//課程信息結構體{intnum1;charname1[20];intscore;intnelepeo;//課程已選人數(shù)intMelepeo;//課程人數(shù)上限structcouse*next;};structstudent//學生信息結構體{intnum2;charname2[20];intnelenum[50];//已選課程編號intnelen;//已
4、選課程數(shù)量structstudent*next;};voidMs(){for(kk1=0;kk1<1100;kk1++)for(kk2=0;kk2<1200;kk2++)for(kk3=0;kk3<1200;kk3++);}voidkeyboardc()//錄入課程子函數(shù)(從鍵盤錄入){structcouse*p1,*p2;N1=0;p1=p2=(structcouse*)malloc(sizeof(structcouse));printf("課程編號t課程名稱t學分t課程人數(shù)上限");scanf("%d%s%d%d",&p
5、1->num1,p1->name1,&p1->score,&p1->Melepeo);p1->nelepeo=0;head1=NULL;while(p1->num1!=0){N1=N1+1;if(N1==1)head1=p1;.....elsep2->next=p1;p2=p1;p1=(structcouse*)malloc(sizeof(structcouse));scanf("%d%s%d%d",&p1->num1,p1->name1,&p1->score,&p1->Melepeo);p1->nelepeo=0;}p2->next
6、=NULL;}voidfilec()//錄入鍵盤子函數(shù)(從文件錄入){FILE*fp;charfilepath[20];structcouse*p1,*p2;N1=0;printf("輸入要讀入的文件路徑:");getchar();gets(filepath);if((fp=fopen(filepath,"r"))==NULL){printf("找不到%s文件!",filepath);exit(0);}p1=p2=(structcouse*)malloc(sizeof(structcouse));fscanf(fp,"%d%s%d
7、%d%d",&p1->num1,p1->name1,&p1->score,&p1->nelepeo,&p1->Melepeo);head1=NULL;while(!feof(fp)){N1=N1+1;if(N1==1)head1=p1;elsep2->next=p1;p2=p1;p1=(structcouse*)malloc(sizeof(structcouse));fscanf(fp,"%d%s%d%d%d",&p1->num1,p1->name1,&p1->score,&p1->nelepeo,&p1->Melepeo);}p2-
8、>next=NULL;}voidinputc()//錄入課程主函數(shù){inti;printf("ttt錄入課程信息");printf("1.從鍵盤錄入");printf("2.從文件錄入");....