結構體實現(xiàn)學生成績管理系統(tǒng)_第1頁
結構體實現(xiàn)學生成績管理系統(tǒng)_第2頁
結構體實現(xiàn)學生成績管理系統(tǒng)_第3頁
結構體實現(xiàn)學生成績管理系統(tǒng)_第4頁
結構體實現(xiàn)學生成績管理系統(tǒng)_第5頁
已閱讀5頁,還剩2頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

****

文件名稱:基于結構體數(shù).文件標識:摘要結構體數(shù)組實現(xiàn)學生績管理系統(tǒng)要求:多么成績的錄入,查詢某個學生(姓名,學號)的成績,計算某學生平均分,某門成績平均分的排名,退出。/***************************文*********************************/<stdlib.h>/***************************量***********************************/N3MAX//記的最大數(shù)量/****************************構********************************/structstudent{;/*學號由10個符組*name[15];/*學生姓*floatscore[N]/*各門課成績*floatsum;/*總分*floataverage;/*平均分*};/********************************局變量*************************/intcount;//記錄生總人數(shù)structstudent//錄學生信息/********************************數(shù)聲明*************************/void//輸學生信息void//輸學生信息void顯示菜單voidcomputer();//算學生成績voidfind();根據(jù)學號或名查詢成績voidsort();//績排名intvoid*avoid*b);排序規(guī)則

/***********************************函數(shù)************************/void{int;count{PrintMenu();switch(choose){1input();//輸入成績;2find();//查成績;3computer();//統(tǒng)成績;4////按績排序,按名次輸出成績//調(diào)用庫函數(shù)中的排序方法output();;5}printf("\n\n");}}

/*********************************序規(guī)則***********************/intvoid*avoid*b){structstudent*aa=student*)astructstudent*bb=(struct*)b;if(!=bb->sum){aa->sumbb->sum?1-1;}{!=bb->score[0])<:-1;!=bb->score[1])<:-1;!=bb->score[2])<:-1;}0;}/******************************************************************數(shù)名PrintMenu**述顯示操作菜單*口數(shù):無*口數(shù):無******************************************************************/voidPrintMenu(){printf("--------------------------------------\n");printf("|

學生成績管理系統(tǒng)

|\n");printf("|成績錄入

|\n");printf("|成績查(號或姓名)|\n");printf("|成績統(tǒng)(均成績|\n");printf("|成績排名printf("|任意鍵退出printf("--------------------------------------");printf("\n");printf("\n");printf("輸入您要進行的操作

|\n");|\n");}

/******************************************************************數(shù)名input**述輸入學生信息**口數(shù):無**口數(shù):無******************************************************************/voidinput(){int;float;printf("輸入要錄入的學生的人數(shù)");for(i=0;i<n;i++){printf("入第個學生信息printf("號:");printf("名:");printf("績1:printf("績2:printf("績3:}countn}

/******************************************************************數(shù)名find**述根據(jù)學號或姓名查詢成績**口數(shù):無**口數(shù):無******************************************************************/voidfind(){inti;ch[15];printf("輸入學號或姓名scanf("%s",ch);printf("--------------------------------------------------------\n");printf("|學號for(i=0;i<count;i++){

姓名成績成2|成績3|總分平均分\n");if(!strcmp(ch,stud[i].no)){stud[i].no,stud[i].name,stud[i].score[0],stud[i].score[1],stud[i].score[2],stud[i].sum,stud[i].average);printf("--------------------------------------------------------\n");}}printf("有找到該學生的信息!\n");printf("--------------------------------------------------------\n");}

/******************************************************************數(shù)名computer**述計算學生總成績和平均成績**口數(shù):無**口數(shù):無******************************************************************/voidcomputer(){inti;=0;i<;i++){stud[i].sum+stud[i].score[2];=(stud[i].score[0]+stud[i].score[1]+stud[i].score[2])/N;}output();}/******************************************************************數(shù)名output**述輸出學生所有信息**口數(shù):無**口數(shù):無******************************************************************/void{inti;printf("--------------------------------------------------------\n");printf("|學號

姓名成績成2|成績3|總分平均分\n");=0;i<;i++){stud[i].no,stud[i].name,stud[i].score[0],stud[i].score[1],stud[i].score[2],stud[i].sum,stud[i].average);}printf("--------------------------------------------------------\n");}

/******************************************************************數(shù)名**述排序**口數(shù):無**口數(shù):無******************************************************************/void{intstructstudent;=0;i<count-1;i{stud[i].sum

溫馨提示

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

評論

0/150

提交評論