学生选课系统代码.doc

学生选课系统代码.doc

ID:49661733

大小:79.50 KB

页数:15页

时间:2020-03-03

学生选课系统代码.doc_第1页
学生选课系统代码.doc_第2页
学生选课系统代码.doc_第3页
学生选课系统代码.doc_第4页
学生选课系统代码.doc_第5页
资源描述:

《学生选课系统代码.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、.#include#includeintN1,N2,kk1,kk2,kk3;structcouse*head1;structstudent*head2;structcouse{intnum1;charname1[20];intscore;intnelepeo;intMelepeo;structcouse*next;};structstudent{intnum2;charname2[20];intnelenum[50];intnelen;structstudent*next;};voidMs(){for(kk1=0;kk1<1100;kk1++)fo

2、r(kk2=0;kk2<1200;kk2++)for(kk3=0;kk3<1200;kk3++);}voidkeyboardc(){structcouse*p1,*p2;N1=0;p1=p2=(structcouse*)malloc(sizeof(structcouse));printf("课程编号t课程名称t学分t课程人数上限");scanf("%d%s%d%d",&p1->num1,p1->name1,&p1->score,&p1->Melepeo);p1->nelepeo=0;head1=NULL;while(p1->num1!=0){N1=N1+1;if(N1==1)

3、head1=p1;elsep2->next=p1;p2=p1;p1=(structcouse*)malloc(sizeof(structcouse));Word资料.scanf("%d%s%d%d",&p1->num1,p1->name1,&p1->score,&p1->Melepeo);p1->nelepeo=0;}p2->next=NULL;}voidfilec(){FILE*fp;charfilepath[20];structcouse*p1,*p2;N1=0;printf("输入要读入的文件路径:");getchar();gets(filepath);if((fp=fopen(

4、filepath,"r"))==NULL){printf("找不到%s文件!",filepath);exit(0);}p1=p2=(structcouse*)malloc(sizeof(structcouse));fscanf(fp,"%d%s%d%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

5、(structcouse));fscanf(fp,"%d%s%d%d%d",&p1->num1,p1->name1,&p1->score,&p1->nelepeo,&p1->Melepeo);}p2->next=NULL;}voidinputc(){inti;printf("ttt录入课程信息");printf("1.从键盘录入");printf("2.从文件录入");printf("3.返回主菜单");printf("请选择(1~3):");scanf("%d",&i);switch(i){Word资料.case(1):keyboardc();break

6、;case(2):filec();break;case(3):break;}}voidinsertc(structcouse*incouse){structcouse*p0,*p1,*p2;p1=head1;p0=incouse;if(head1==NULL){head1=p0;p0->next=NULL;}else{while((p0->num1>p1->num1)&&(p1->next!=NULL)){p2=p1;p1=p1->next;}if(p0->num1<=p1->num1){if(head1==p1)head1=p0;elsep2->next=p0;p0->next=p1

7、;}else{p1->next=p0;p0->next=NULL;}}N1=N1+1;}voiddelc(intnum1){structcouse*p1,*p2;if(head1==NULL){printf("没有课程,无法删除!");gotoend;}Word资料.p1=head1;while(num1!=p1->num1&&p1->next!=NULL){p2=p1;p1=p1->next;}if(num1==p1->num1){i

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。