![學(xué)生綜合測評系統(tǒng)_第1頁](http://file4.renrendoc.com/view/7930be417543ee8bdcdf72157b54008d/7930be417543ee8bdcdf72157b54008d1.gif)
![學(xué)生綜合測評系統(tǒng)_第2頁](http://file4.renrendoc.com/view/7930be417543ee8bdcdf72157b54008d/7930be417543ee8bdcdf72157b54008d2.gif)
![學(xué)生綜合測評系統(tǒng)_第3頁](http://file4.renrendoc.com/view/7930be417543ee8bdcdf72157b54008d/7930be417543ee8bdcdf72157b54008d3.gif)
![學(xué)生綜合測評系統(tǒng)_第4頁](http://file4.renrendoc.com/view/7930be417543ee8bdcdf72157b54008d/7930be417543ee8bdcdf72157b54008d4.gif)
![學(xué)生綜合測評系統(tǒng)_第5頁](http://file4.renrendoc.com/view/7930be417543ee8bdcdf72157b54008d/7930be417543ee8bdcdf72157b54008d5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
include<stdio.h>include"stdlib.h"include"string.h"#include<iostream.h>structstudent*Read();voidsave(structstudent*head);voidsinput(structstudent*p);structstudent*input();voidpaixu_num(structstudent*head);structstudent*insert();structstudent*alter();structstudent*del();voidfind_num(structstudent*phead);voidfind_name(structstudent*phead);voidoutput();voidmin_student(structstudent*phead);voidmax_student(structstudent*phead);voidave_student(structstudent*phead);voidevery_student(structstudent*phead);voidscore_paixu(structstudent*head);voidhelp();voidtj_menu(structstudent*head);voidfind_menu(structstudent*head);voidmenu();structstudent"/定義學(xué)生信息結(jié)構(gòu)數(shù)組,用于學(xué)生信息輸入charnumber[13];charname[13];charsex[4];charadds[15];charphone[14];charqq[14];floatchinese,math,english,txhp,pinde,teacher;intzcmc,ksmc;doubleave,zc;structstudent*next;};defineLensizeof(structstudent)intlen;//鏈表長度inta=0,b=0,c=0,d=0,e=0;//用來存放成績各階的人數(shù)charstu[10];structstudent*Read(){//讀取數(shù)據(jù)文件保存到鏈表中,返回指向此鏈表頭指針structstudent*head=NULL;structstudent*p1,*p2;FILE*fp;cout<<"請輸入你要打開的文件(.dat)"<<endl;cin>>stu;if((fp=fopen(stu,"rb+"))==NULL){cout<〈”打開文件出錯!“<<endl;exit(0);}while(!feof(fp)){if((p1=(structstudent*)malloc(Len))==NULL){cout<<"內(nèi)存申請出錯"<<endl;fclose(fp);exit(0);}if(fread(p1,Len,1,fp)!=1){free(p1);break;}if(head==NULL)head=p2=p1;else{p2->next=p1;p2=p1;}}fclose(fp);returnhead;}voidsave(structstudent*head){//數(shù)據(jù)存盤FILE*fp;structstudent*p;p=head;cout<<"請輸入你要存進(jìn)去的文件(.dat)"<<endl;cin>>stu;if((fp=fopen(stu,"wb"))==NULL){cout<<〃無法打開文件!”<<endl;system("pause");menu();}while(p){if(fwrite(p,Len,1,fp)!=1){cout<<〃寫入數(shù)據(jù)出錯〃<<endl;fclose(fp);return;}elsep=p->next;}cout<<〃數(shù)據(jù)存入成功!請按任意鍵繼續(xù)!"<<endl;getchar();fclose(fp);}〃單次輸入voidsinput(structstudent*p){cout<<〃請輸入學(xué)號:"<<endl;cin>>p->number;cout<<〃請輸入姓名:“<<endl;cin>>p->name;cout<<〃請輸入性別:〃<<endl;cin>>p->sex;cout<<〃請輸入家庭住址:"<<endl;cin>>p->adds;cout<<〃請輸入聯(lián)系電話:“<<endl;cin>>p->phone;cout<<〃請輸入口口:“<<endl;cin>>p->qq;cout<<〃請輸入語文成績:〃<<endl;cin>>p->chinese;if(p->chinese>100||p->chinese<0){cout<<〃成績輸入不符合規(guī)定,請重新輸入:〃<<endl;cin>>p->chinese;}cout<<〃請輸入數(shù)學(xué)成績:“<<endl;cin>>p->math;if(p->math>100||p->math<0){cout<<〃成績輸入不符合規(guī)定,請重新輸入:〃<<endl;cin>>p->math;}cout<<〃請輸入英語成績:〃<<endl;cin>>p->english;if(p->english>100||p->english<0){cout<<〃成績輸入不符合規(guī)定,請重新輸入:〃<<endl;cin>>p->english;}cout<<〃請輸入同學(xué)互評分:〃<<endl;cin>>p->txhp;if(p->txhp>100||p->txhp<0){cout<<〃成績輸入不符合規(guī)定,請重新輸入:〃<<endl;cin>>p->txhp;}cout<<〃請輸入品德成績:〃<<endl;cin>>p->pinde;if(p->pinde>100||p->pinde<0){cout<<〃成績輸入不符合規(guī)定,請重新輸入:〃<<endl;cin>>p->pinde;}cout<<〃請輸入任課教師評分:〃<<endl;cin>>p->teacher;if(p->teacher>100||p->teacher<0){cout<<〃成績輸入不符合規(guī)定,請重新輸入:〃<<endl;cin>>p->teacher;}p->ave=(p->chinese+p->math+p->english)/3.0;p->zc=(p->ave*0.6+p->txhp*0.1+p->pinde*0.2+p->teacher*0.1);cout<<endl;^^〈〈“☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆〃<<endl;cout<<〃你剛輸入的信息為:〃<<endl;cout<<"\t\t學(xué)號:"<<p->number<<endl;cout<<"\t\t姓名:"<<p->name<<endl;cout<<"\t\t性別:“<<p->sex<<endl;cout<<"\t\t家庭住址:"<<p->adds<<endl;cout<<"\t\t聯(lián)系電話:"<<p->phone<<endl;cout<<"\t\tQQ號:"<<p->qq<<endl;cout<<"\t\t語文成績:“<<p->chinese<<endl;cout<<"\t\t數(shù)學(xué)成績:"<<p->math<<endl;cout<<"\t\t英語成績:"<<p->english<<endl;cout<<"\t\t品德成績:"<<p->pinde<<endl;cout<<"\t\t教師評分:"<<p->teacher<<endl;^^〈〈“☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆〃<<endl;return;}〃學(xué)生成績錄入函數(shù)structstudent*input(){structstudent*head=NULL,*p1,*p2;//輸入p1,p2鏈表最后節(jié)點charch='y';len=1;p2=p1=(structstudent*)malloc(sizeof(structstudent));cout<<〃請輸入第〃<<len<<〃個學(xué)生的信息:〃<<endl;sinput(p1);cout<<endl;。??诓芬话磏退出或按任意鍵繼續(xù)“<<endl;;cin>>ch;while⑴{if(len==1)//作為頭結(jié)點head=p1;elsep2->next=p1;p2=p1;if(ch=='N'||ch=='n')break;p1=(structstudent*)malloc(sizeof(structstudent));system("cls");len++;cout<<"請輸入第"<<r水<"個學(xué)生的信息:"<<endl;;sinput(p1);cout<<endl;。。a<<“按n退出或按任意鍵繼續(xù)"<<endl;;cin>>ch;}p2->next=NULL;paixu_num(head);cout<〈"輸入學(xué)生信息完成!請按任意鍵返回主菜單!"<<endl;getchar();returnhead;}//學(xué)號排序voidpaixu_num(structstudent*head){structstudentt,*r,*p,*q;//t交換p、q,r頭結(jié)點r=head;if(r==NULL){cout<<"學(xué)生信息不存在,請先輸入學(xué)生信息!"<<endl;return;}while(r){p=r;q=r->next;while(q){if(strcmp(q->number,p->number)<0)//q<p{strcpy(t.number,q->number);strcpy(,q->name);strcpy(t.sex,q->sex);strcpy(t.adds,q->adds);strcpy(t.phone,q->phone);strcpy(t.qq,q->qq);t.chinese=q->chinese;t.math=q->math;t.english=q->english;t.txhp=q->txhp;t.pinde=q->pinde;t.teacher=q->teacher;strcpy(q->number,p->number);strcpy(q->name,p->name);strcpy(q->sex,p->sex);strcpy(q->adds,p->adds);strcpy(q->phone,p->phone);strcpy(q->qq,p->qq);q->chinese=p->chinese;q->math=p->math;q->english=p->english;q->txhp=p->txhp;q->pinde=p->pinde;q->teacher=p->teacher;strcpy(p->number,t.number);strcpy(p->name,);strcpy(p->sex,t.sex);strcpy(p->adds,t.adds);strcpy(p->phone,t.phone);strcpy(p->qq,t.qq);p->chinese=t.chinese;p->math=t.math;p->english=t.english;p->txhp=t.txhp;p->pinde=t.pinde;p->teacher=t.teacher;}q=q->next;}r=r->next;}}//插入函數(shù)structstudent*insert(){structstudent*p,*p1,*head;head=Read();p1=head;p=(structstudent*)malloc(sizeof(structstudent));charnum[14],ch;cout<<"請輸入你要插入的前一個學(xué)生的學(xué)號:"<<endl;cin>>num;while(p1){if(!strcmp(p1->number,num)){sinput(p);p->next=p1->next;p1->next=p;len++;}elsep1=p1->next;。。a<<“按n退出或按任意鍵繼續(xù)"<<endl;;cin>>ch;if(ch=='N'||ch=='n')break;}cout<<"學(xué)生信息插入成功!請按任意鍵返回!"<<endl;getchar();returnhead;}//修改學(xué)生信息structstudent*alter(){chartemp[13];structstudent*p,*head;head=Read();p=head;cout<<"請輸入要修改學(xué)生的學(xué)號:";cin>>temp;while(p){if(!strcmp(p->number,temp)){sinput(p);}p=p->next;}cout<<endl;cout<<"學(xué)生信息修改成功!請按任意鍵返回!"<<endl;cout<<endl;system("pause");returnhead;}//刪除學(xué)生信息structstudent*del(){chartemp[13];intm=0;structstudent*p1,*p,*head;//p1刪除head=Read();p1=p=head;cout<<"請輸入你要刪除學(xué)生的學(xué)號:"<<endl;cin>>temp;while(p){if(strcmp(p1->number,temp)==0){if(p1==head)//刪除的頭結(jié)點head=p1->next;elsep->next=p1->next;len--;m=1;cout<<"學(xué)生信息刪除成功!請按任意鍵返回主菜單"<<endl;getchar();returnhead;}elsep=p->next;}if(!m)cout<<”查找不到這個信息!”<<endl;returnhead;}voidfind_num(structstudent*head)//按學(xué)號查找{structstudent*p=head;chartemp[9];intm=0;cout<<"請輸入要查找的學(xué)生的學(xué)號"<<endl;cin>>temp;while(p!=NULL){if(strcmp(p->number,temp)==0){cout<<“該學(xué)生的具體信息為:"<<endl;cout<<endl;^^〈〈“☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆〃<<endl;cout<<"\t\t學(xué)號:"<<p->number<<endl;cout<<"\t\t姓名:"<<p->name<<endl;cout<<"\t\t性別:“<<p->sex<<endl;cout<<"\t\t家庭住址:"<<p->adds<<endl;cout<<"\t\t聯(lián)系電話:"<<p->phone<<endl;cout<<"\t\tQQ號:"<<p->qq<<endl;cout<<"\t\t語文成績:“<<p->chinese<<endl;cout<<"\t\t數(shù)學(xué)成績“<<p->math<<endl;cout<<"\t\t英語成績“<<p->english<<endl;cout<<"\t\t平均成績“<<p->ave<<endl;cout<<"\t\t品德成績“<<p->pinde<<endl;cout<<"\t\t老師評分“<<p->teacher<<endl;cout<<"\t\t綜合成績“<<p->zc<<endl;score_paixu(head);cout<<"\t\t考試名次“<<p->ksmc<<endl;cout<<"\t\t綜測名次“<<p->zcmc<<endl;^^〈〈“☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆〃<<endl;cout<<endl;m=1;}p=p->next;//繼續(xù)向下尋找}if(!m)cout<<〃查找不到這個學(xué)號的信息!〃<<endl;。加^^按任意鍵返回主菜單……〃<<endl;getchar();return;}voidfind_name(structstudent*head)//按姓名查找{structstudent*p=head;chartemp[9];intm=0;cout<<〃請輸入要查找的學(xué)生的姓名〃<<endl;cin>>temp;while(p){if(strcmp(p->name,temp)==0){cout<<“該學(xué)生的具體信息為:"<<endl;cout<<endl;^^〈〈“☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆〃<<endl;cout<<〃學(xué)號:"<<p->number<<endl;cout<<"\t\t姓名:"<<p->name<<endl;cout<<"\t\t性別:“<<p->sex<<endl;cout<<"\t\t家庭住址:"<<p->adds<<endl;cout<<"\t\t聯(lián)系電話:"<<p->phone<<endl;cout<<"\t\tQQ號:"<<p->qq<<endl;cout<<"\t\t語文成績:“<<p->chinese<<endl;cout<<"\t\t數(shù)學(xué)成績“<<p->math<<endl;cout<<"\t\t英語成績“<<p->english<<endl;cout<<"\t\t平均成績“<<p->ave<<endl;cout<<"\t\t品德成績“<<p->pinde<<endl;cout<<"\t\t老師評分“<<p->teacher<<endl;cout<<"\t\t綜合成績“<<p->zc<<endl;score_paixu(head);cout<<"\t\t考試名次“<<p->ksmc<<endl;cout<<"\t\t綜測名次“<<p->zcmc<<endl;^^〈〈“☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆〃<<endl;cout<<endl;m=1;}p=p->next;}if(!m)cout<<〃查找不到這個學(xué)號的信息!〃<<endl;。加^^按任意鍵返回主菜單……〃<<endl;getchar();return;}voidoutput(){structstudent*p,*head;head=Read();p=head;inti=1;while(p){^^〈〈“☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆〃<<endl;cout<<〃\t\t學(xué)號:〃<<p->number<<endl;cout<<"\t\t姓名:“<<p->name<<endl;cout<<"\t\t性別:“<<p->sex<<endl;cout<<"\t\t家庭住址:"<<p->adds<<endl;cout<<"\t\t聯(lián)系電話:"<<p->phone<<endl;cout<<"\t\tQQ號:"<<p->qq<<endl;cout<<"\t\t語文成績:“<<p->chinese<<endl;cout<<"\t\t數(shù)學(xué)成績:"<<p->math<<endl;cout<<"\t\t英語成績:"<<p->english<<endl;cout<<"\t\t品德成績:"<<p->pinde<<endl;cout<<"\t\t老師評分:"<<p->teacher<<endl;cout<<"\t\t平均成績:“<<p->ave<<endl;cout<<"\t\t綜合成績:"<<p->zc<<endl;score_paixu(head);cout<<"\t\t考試名次“<<p->ksmc<<endl;cout<<"\t\t綜合測評名次“<<p->zcmc<<endl;p=p->next;i++;}^^〈〈”■■■■■■■■■■■■■■■■■■■■■■■■"<<endl;cout<<endl;cout<<〃請按任意鍵返回主菜單……〃<<endl;getchar();return;}voidmax_student(structstudent*head){structstudent*p=head;floatc2=0,m2=0,e2=0,s2=0,p2=0,stu2=0,t2=0;doublea2=0,zc2=0;while(p){if(p->chinese>c2)c2=p->chinese;if(p->math>m2)m2=p->math;if(p->english>e2)e2=p->english;if((p->chinese+p->math+p->english)>s2)s2=(p->chinese+p->math+p->english);if(p->pinde>p2)p2=p->pinde;if(p->txhp>stu2)stu2=p->txhp;if(p->teacher>t2)t2=p->teacher;if(p->
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025屆山東省蘭陵縣中考三模生物試題含解析
- 湖南長沙雅禮實驗中學(xué)2025屆中考生物考試模擬沖刺卷含解析
- 2025屆湖北省武漢市十一校中考考前最后一卷生物試卷含解析
- 2025屆貴州省劍河縣中考生物押題試卷含解析
- 2025幼兒園后勤工作計劃報告
- 運輸安裝合同范本
- 河南焦作市沁陽市重點中學(xué)2025屆中考一模生物試題含解析
- 城市綜合交通樞紐建設(shè)合作協(xié)議
- 房屋裝修合同范本含裝修預(yù)算清單
- 注冊師工程師聘用合同
- 消防器材與消防設(shè)施的維護(hù)與檢查
- 2024年度碳陶剎車盤分析報告
- 2025年1月 浙江首考英語試卷
- 2025年1月廣西2025屆高三調(diào)研考試英語試卷(含答案詳解)
- 2024年中考二輪專題復(fù)習(xí)道德與法治主觀題答題技巧(小論文)之演講稿
- 質(zhì)檢工作計劃書2025質(zhì)檢部工作計劃范文
- 《復(fù)旦大學(xué)》課件
- 《纏論的實戰(zhàn)技法》課件
- 承包魚塘維修施工合同范例
- 耶魯綜合抽動嚴(yán)重程度量表正式版
- 2024年浙江省公務(wù)員錄用考試《行測》題(A類)
評論
0/150
提交評論