最新學(xué)生選課系統(tǒng)源代碼_第1頁(yè)
最新學(xué)生選課系統(tǒng)源代碼_第2頁(yè)
最新學(xué)生選課系統(tǒng)源代碼_第3頁(yè)
最新學(xué)生選課系統(tǒng)源代碼_第4頁(yè)
最新學(xué)生選課系統(tǒng)源代碼_第5頁(yè)
已閱讀5頁(yè),還剩10頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、#include#includeint N1,N2,kk1,kk2,kk3;struct couse * head1;struct student * head2;struct couse/課程信息結(jié)構(gòu)體int num1;struct student/學(xué)生信息結(jié)構(gòu)體int num2;for(kk1=0;kk11100;kk1+)for(kk2=0;kk21200;kk2+)for(kk3=0;kk3num1,p1-name1,&p1-score,&p1-Melepeo);N1=N1+1;if(N1=1)head1=p1;else p2-next=p1;p1=(struct couse * )m

2、alloc(sizeof(struct couse);scanf(%d%s%d%d,&p1-num1,p1-name1,&p1-score,&p1-Melepeo);p1-nelepeo=0;FILE * fp;struct couse *p1,*p2;getchar();gets(filepath);exit(0);head1=NULL;while(!feof(fp)N1=N1+1;if(N1=1)head1=p1;p2=p1;p2-next=NULL;void inputc()/錄入課程主函數(shù)printf(tttn);scanf(%d,&i);switch(i)void insertc(s

3、truct couse *incouse)/課程管理子函數(shù)()p1=head1;p0=incouse;if(head1=NULL)head1=p0;p0-next=NULL;while(p0-num1 p1-num1) & (p1-next!=NULL)if(p0-num1 num1)elseN1=N1+1;struct couse *p1,*p2;if(head1=NULL)p1=head1;p2=p1;p1=p1-next;if(num1=p1-num1)if(p1=head1) head1=p1-next;else p2-next=p1-next;printf(已刪除該編號(hào)課程!n);N

4、1=N1-1;struct couse * incouse;int i,num1;case(1):incouse=(struct couse *)malloc(sizeof(struct couse);scanf(%d%s%d%d,&incouse-num1,incouse-name1,&incouse-score,&incocase(2):case(3):break;void keyboards()/錄入學(xué)生信息子函數(shù)(從鍵盤錄入)struct student *p1,*p2;printf(t學(xué)生姓名n);p1-nelen=0;head2=NULL;while(p1-num2!=0)N2=N

5、2+1;if(N2=1)head2=p1;p2=p1;p1=(struct student * )malloc(sizeof(struct student);p1-nelen=0;p2-next=NULL;int i=0;FILE * fp;char filepath20;struct student *p1,*p2;N2=0;gets(filepath);exit(0);fread(p1,sizeof(struct student),1,fp);head2=NULL;while(!feof(fp)i=0;N2=N2+1;if(N2=1)head2=p1;p2=p1;p1=(struct st

6、udent * )malloc(sizeof(struct student);fread(p1,sizeof(struct student),1,fp);p2-next=NULL;printf(tttn);printf(2.n);printf(3.n);scanf(%d,&i);switch(i)case(2):files();break;case(3):break;p0=incouse;if(head2=NULL)head2=p0;p0-next=NULL;while(p0-num2 p1-num2) & (p1-next!=NULL)if(p0-num2 num2)elseN2=N2+1;

7、void dels(int num2)/學(xué)生信息管理子函數(shù)(刪除學(xué)生信息)struct student *p1,*p2;if(head2=NULL)printf(n沒(méi)有該學(xué)生信息,無(wú)法刪除!n);p1=head2;p2=p1;p1=p1-next;if(num2=p1-num2)if(p1=head2) head2=p1-next;else p2-next=p1-next;printf(已刪除該學(xué)生信息!n);N2=N2-1;printf(tttn);printf(1.新增學(xué)生信息n);printf(2.刪除學(xué)生信息n);printf(3.n);printf(請(qǐng)選擇(13):n);scanf(

8、%d,&i);switch(i)case(1):incouse=(struct student *)malloc(sizeof(struct student);incouse-nelenum0=0;printf(t學(xué)生姓名n);scanf(%d%s,&incouse-num2,incouse-name2);inserts(incouse);case(2):case(3):break;scanf(%d,&num1);for(i=0;s-nelenumi!=0;i+);s-nelenumi=num1;(s-nelen)+;p=head1;while(p-num1!=num1) p=p-next;(

9、p-nelepeo)+;scanf(%d,&num2);s=head2;while(s-num2!=num2 & s-next!=NULL) s=s-next;if(s-num2!=num2)c=head1;printf(你的可選課程編號(hào):n);while(c!=NULL)for(t=0,i=0;s-nelenumi!=0;i+)if(c-num1=s-nelenumi) t=1;if(t=0 & (c-nelepeo!=c-Melepeo)c=c-next;if(j=0)printf(你已選完所有課程,無(wú)法再多選!n);getchar();e=getchar();i=0;while(e=y)

10、elect(s);printf(y/n)?:n);getchar();e=getchar();printf(請(qǐng)輸入你要退掉的課程編號(hào):n);scanf(%d,&num1);p1=head1;for(i=0;p-nelenumi!=num1;i+);p-nelenum-j=0;(p1-nelepeo)-;printf(退課成功!n);printf(請(qǐng)輸入學(xué)號(hào):n);scanf(%d,&num2);p=head2;while(p-num2!=num2 & p!=NULL) p=p-next;if(p=NULL)printf(,請(qǐng)回主菜單錄入信息:n);if(p-nelenum0=0)p0=head

11、1;while(p0-num1!=p-nelenumi) p0=p0-next;f=f+p0-score;getchar();c=getchar();while(c=y)back(p);void elective()/學(xué)生選課主函數(shù)switch(i)case(1):cheak();break;case(2):hcheak();break;case(3):break;p=head1;p=p-next;printf(%-4d %10s %6dn,p-num2,p-name2,p-nelen);p=p-next;FILE * fp;getchar();gets(filepath);exit(0);p=head1;while(p!=NULL)p=p-next;fclose(fp);printf(課程信息已保存在%s!n,filepath);FILE * fp;getchar();gets(filepath);exit(0);p=head2;while(p!=NULL)fwrite(p,sizeof(struct student),1,fp);p=p-next;fclose(fp);printf(學(xué)生信息已保存在%s!n,filepath);void into()/存儲(chǔ)信息case(1):intoc();break;case(2):intos();break;case(3):

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論