电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

2025年整理C语言学生选课系统

2025年整理C语言学生选课系统_第1页
1/26
2025年整理C语言学生选课系统_第2页
2/26
2025年整理C语言学生选课系统_第3页
3/26
C 语言学生选课系统(代码)#include#include#includeintN1,N2;structstudentintnum2;charname2[20];intnelenum[50];//所选课程编号intnelen;//所选课程学分和structstudent*next;structcourseintnum1;//课程编号charname1[20];charmajor[20];chartype[20];intcredit;intperiod;charteacher[20];intpeople;//选此门课程的人数structcourse*next;//结构体指针structcourse*head1;structstudent*head2;voidzhang()//从键盘录入课程信息structcourse*p1,*p2;N1=0;p1=p2=(structcourse*)malloc(sizeof(structcourse));printf("课程编号\t 课程名称\t 主修\t 课程性质\t 学分\t 课时\t 老师\n");scanf("%d%s%s%s%d%d%s",&p1->num1,p1->name1,p1->major,p1->type,&p1->credit,&p1->period,p1->teacher);p1->people=0;head1=NULL;while(p1->num1!=0)N1=N1+1;if(N1==1)head1=p1;elsep2->next=p1;p2=p1;p1=(structcourse*)malloc(sizeof(structcourse));scanf("%d%s%s%s%d%d%s",&p1->num1,p1->name1,p1->major,p1->type,&p1->credit,&p1->period,p1->teacher);p1->people=0;p2->next=NULL;voidzhang1()//从文件录入课程信息FILE*fp;charfilepath[20];structcourse*p1,*p2;N1=0;printf("请输入您要读取的路径:");getchar();gets(filepath);if((fp=fopen(filepath,"r"))==NULL)printf("找不到%s 文件!\n",filepath);exit(0);p1=p2=(structcourse*)malloc(sizeof(structcourse));fscanf(fp,"%d%s%s%s%d%d%s%d",&p1->num1,p1->name1,p1->major,p1->type,&p1->credit,&p1->period,p1->teacher,&p1->people);while(!feof(fp))N1=N1+1;if(N1==1)head1=p1;elsep2->next=p1;p2=p1;p1=(structcourse*)malloc(sizeof(structcourse));fscanf(fp,"%d%s%s%s%d%d%s%d",&p1->num1,p1->name1,p1->major,p1->type,&p1->credit,&p1->period,p1->teacher,&p1->people);p2->next=NULL;voidload()//录入课程信息函数inti;printf("\t\t\t 录入课程信息\n");printf("\n1.从键盘录入");printf("\n2.从文件录入");printf("\n3.返回主菜单\n");printf("请选择 1-3:");scanf("%d",&i);switch(i)case1:zhang();break;case2:zhang1();break;case3:break;voidinsert(structcourse*incourse)// 增加课程信息structcourse*p0,*p1,*p2;p1=head1;p0=incourse;if(head1==NULL)head1=p0;p0->next=NULL;elsewhile((p0->num1>p1->num1)&&(p1->next!=NULL))p2=...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

2025年整理C语言学生选课系统

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部