




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
1、enj -usta eaitor Transf-orm Graphs Utilities Add-ons Window Help 北京市 Reports Descriptive Statistics Tobies Il資性收入 Jfiosw 疑苣性匸 1095 00 財產(chǎn)性性收 5800 鯉性童 788 235( Generalized Linear Models 156; MJxd Modek 177i Correlate 324( Re?gres$ioh 27V Log linear 216S Neural Networks 193: ! Citify1 241 17d 149( DaU
2、Reduction卜 Scale INonpametric Tests Time Series1 Survival Missing Vdue Analysis. NuFbple Reip /*輸入數(shù)據(jù)函數(shù)*/ void sort () ;/*排序數(shù)據(jù)函數(shù)*/ void sor(); void sort2 (); void sort3 (); void d i sp I ay () ;/*顯示數(shù)據(jù)函數(shù)*/ void dispIay1 (); void insert () ; /*插入數(shù)據(jù)函數(shù)*/ void del () ; /*刪除數(shù)據(jù)函數(shù)*/ void average() ; /*平均值函數(shù)*
3、/ void f i nd 0 ;/*查找數(shù)據(jù)函數(shù)*/ void f ind1 (); void f i nd2 (); void save() ; /*保存數(shù)據(jù)函數(shù)*/ void read () ; /*讀出數(shù)據(jù)函數(shù)*/ void de l_f i Ie () ;/*刪除文件函數(shù)*/ void modify 0 ; /*修改文件函數(shù)*/ i nt noWnon; struet student int no; char name20; char sex4; float scorel; fIoat score2; float score3; fIoat sort; float ave; fIoa
4、t sum; struct student stuMAX, *p; ma i n 0 /*主函數(shù)*/ int as; char ch; do start: printf (nnnttt歡迎使用學生成績管理系統(tǒng) n“); prJntf (”nnnnnntt* 按任意 鍵繼續(xù) * ”) ch二getch (); while (!ch); system(cl su); /*一下為功能選擇模塊*/ do printf (nntttt1.錄入學員信息ntttt2.顯示學員 總成績信息ntttt3.對總成績排序ntttt4.顯示學員單科 成績排序ntttt5.添加學員信息ntttt6.刪除學員信息 ntt
5、tt7.修改學員信息ntttt8.查詢學員信息ntttt9. 從文件讀入學員信息ntttt10.刪除文件中學員信息 ntttt11.保存學員信息ntttt12.退出nH); printfCWW選擇功能選項(輸入所選功能前的數(shù) 字):O ; ffIush (std i n); /*可用可不用,用于清除緩存防止下次用scanf輸入是出現(xiàn)錯 誤*/ seanf (%d, switch (as) case 1:system (cIs); input (); break; display (); break; case 3:systemCcIs); sort(); break; case 4:syste
6、m(HcIsu); displayl (); break; case 5:systemCcIs); insert (); break; case 6:systemCcIs); de I (); break; case 7:system(”cls); mod i f y (); break; case 8:system(”cls”); f ind(); break; case 9:systemCcIs); read (); break; case 10:system(cls); de l_f i I e (); break; case 11:system(cls); save (); break
7、; ex i t (0); defauIt:system(cls); goto start; wh i le(1) ;/*wh i I e (1), 1表示真,所以whi le (1)表示永遠循環(huán)下 去,一般在whi le(1 )的循環(huán)體內(nèi)都有break或者return跳出循環(huán) */ /*至此功能選擇結(jié)束*/ void input 0/*原始數(shù)據(jù)錄入模塊*/ int i=0; char ch; do pr intf (tttt1.錄入學員信息n輸入第d個學 員的信息nH, i+1); pr i ntf (n輸入學生編號:); seanf (%d, fflush(stdin); pr intf
8、(n輸入學員姓名:); ff lush(stdin); gets(stui name); pr intf (n輸入學員性別:); ff lush(stdin); gets (stui sex); pr intf (n輸入學員成績1 :; scanf (%f, pr intf (n輸入學員成績2:); ffIush (std i n); seanf pr intf (Hn輸入學員成績3:H); fflush(stdin); seanf (%f, printfCW); i+; now_no二 i; printf (n是否繼續(xù)輸入(Y/N) ”); fflush(stdin); ch二getch (
9、); systemCcIs”); ) while(ch! = ,n, void sortO/*排序數(shù)據(jù)函數(shù)*/ struet student temp; int i, j; average (); for (i=1;inow_no;i +) for (j=1;j=now_no-i;j+) if (stu jT. avestu j ave) temp=stu j; stuj=stuj-1; stu jT二 t emp; printfC*排序以完成進入功能2可進行顯示n”); system(”pause); system(ncls); void sortl ()/*排序數(shù)據(jù)函數(shù)*/ struet
10、student temp; int i, j; for (i=1;inow_no;i +) for (j=1;j=now_no-i;j+) if (stujT scoreKstuj scorel) temp二stu j; Stuj=stuj-1; stu j_1emp; void sort2 0/*排序數(shù)據(jù)函數(shù)*/ struet student temp; int i,j; for (i=1;inow_no;i +) for (j=1;j=now_no-i;j+) i f (stuj-1 score2stuj score2) temp二stuj; Stuj=stuj-1; stuj_1emp;
11、 void sort3 ()/*排序數(shù)據(jù)函數(shù)*/ struet student temp; int i,j; for (i=1;inow_no;i +) for (j=1;j=now_no-i;j+) if (stuj-1. score3stuj score3) temp二stu j; Stuj=stuj-1; stuj_1二temp; void d i sp I ay () /*顯示數(shù)據(jù)函數(shù)*/ char as; average (); do printf(nttt班級學員信息列表n“); printf(nt編號t姓名t性別t成績1t成績2t成績 3t平均值n“); for (i=0;ino
12、w_noi+) pr intf(Ht%dt%st%st%. 2ft%. 2ft%. 2ft%. 2f n, stui no, stui. name, stui sex, stui scorel, stui sc ore2,stu iscore3,stu iave); printf(ntt按任意鍵返回主菜單.”); ffIush (std i n); as二getch (); ) while (!as); system(cls); void displayl ()/*顯示數(shù)據(jù)函數(shù)*/ int i; char as; do pr intf (ttt 班級學員 scorel 成績排序n); pr i
13、ntf (t編號t姓名t性別t成績1n); sortl (); for(i=0;inow_noi+) pr i ntf(t%dt%st%st%. 2ftn,stui.no,st ui. name, stui. sex, stui. scorel); pr intf (ttt 班級學員 score2 成績排序n); pr intf (t編號t姓名t性別t成績2n); sort2 (); for (i=0;inow_noi+) pr i ntf(t%dt%st%st%. 2ftn,stu i.no, stu ,stui sex,stui score2); pr intf (ttt 班級
14、學員 score3 成績排序n); pr intf (t編號t姓名t性別t成績3n); sort3 0; for (i=0;i now_noi+) pr i ntf(t%dt%st%st%. 2ftn,stui. no, stu iname,stui.sex,stui score3); printfCtt按任意鍵返回主菜單.”); ff lush(stdin); as二getch (); while (!as); void insert 0 /*插入數(shù)據(jù)函數(shù)*/ char ch; do pr intf (ntt輸入新插入學員隊信息n); pr i ntf (n輸入學生編號:); scanf (
15、u%d, ff lush(stdin); pr intf (n輸入學員姓名:); ff lush(stdin); gets (stunow_no. name); pr intf (n輸入學員性別:); gets (stunow_no. sex); pr intf (n輸入學員成績1 :; fflush(stdin); seanf (n%f pr intf (n輸入學員成績2:); ffIush (std i n); scanf (u%f, pr intf (n輸入學員成績3:); fflush(stdin); scanf (u%f, printf(”nn“); now_no二now_no+1;
16、 sortO ; printf (H是否繼續(xù)輸入(Y/N) ”); ff lush(stdin); ch二getch (); system(”cIs); while(ch!=*n, pr intf (輸入要刪除學員的編號:); fflush(stdin); scanf (%d, for (i 二0;i now_no;i+) i f (stui no二二 i num) i f (i =now_no)now_no-=1; e I se stu i 二stu now_noT ; now_no-=1; sortO ; break; systemCcIs”); void saveO/*保存數(shù)據(jù)函數(shù)*/
17、FILE *fp; char fi I epath 20; printfC*輸入要保存的文件路徑:”); ffIush(std i n); gets(fi lepath); i f (fp=fopen (f i I epath, w) =NULL) pr intf (n 保存失敗!); ex i t (0); for (iO;inow_no;i+) stui sum二stui score1+stui score2 +stu i score3; stu iave二stui. sum/3; fprintf(fp, nt%dt%st%st%. 2ft%.2ft %. 2ft%. 2fn, stu i
18、 . no, stu i . name, stu i . sex, stu i . score 1,stui.score2,stu i.score3,stu i.ave); fc I ose (fp); pr i ntf (學生信息已保存在$中! n, f i I epath); system(pause); system(cls); void f i nd ()/*查詢函數(shù)*/ i nt i; char str 20, as; do pr i ntf (”輸入要查詢的學生姓名:“); ff I ush (std i n); gets(str); for (i=0;i now_no;i +)
19、if (!strcmp(stui name, str) printf (nt編號t姓名t性別t成績1t 成績2t成績3t平均值n); printf(t%dt%st%st%. 2ft%. 2ft%. 2f t% 2fn stu i . no, stu i name, stu i. sex, stu i scorel, st u i.score2,stui.score3,stui ave); printf (ntt按任意鍵返回主菜單.”); ffIush (std i n); as二getch (); while (las); systemCcl s); void average()/*求平均數(shù)*
20、/ int i; for (i 二0;i now_no;i +) stui sum=stui score1+stui score2+stui s core3; stu iave二stui sum/3; void modify ()/*修改數(shù)據(jù)函數(shù)*/ char str 20; printfC*輸入要修改的學生姓名:”); ff lush(stdin); gets(str); for (iO;i now_no;i +) i f (!strcmp (stui name, str) system(cIs”); pr i ntf (ntt輸入新插入學員隊信息n); pr i ntf (n輸入學生編號:); ff lush(stdin); scanf (%d, pr intf (n輸入學員性別:); ff lush(stdin); gets (stui sex); pr intf (n輸入學員成績1 :; fflush(stdin); scanf (%f, pr intf (n輸入學員成績2:); ffIush (std i n); scanf (%f,
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年中國交通工具鎖市場調(diào)查研究報告
- 2025年中國D型廳站板市場調(diào)查研究報告
- 公司銷售組長聘用合同范例
- 低稅費買房合同范例
- 湘潭市雨湖區(qū)小學美術(shù)手工課教學現(xiàn)狀與對策研究
- 小學美術(shù)教學中的情感教育研究
- 工業(yè)縫制機械相關行業(yè)投資規(guī)劃報告
- 碳纖維布相關行業(yè)投資規(guī)劃報告
- 基于Bass模型的主流貿(mào)易新業(yè)態(tài)擴散研究
- 腹瀉癥狀的快速緩解方案
- (新版教材)粵教版六年級下冊科學全冊課件
- 電子產(chǎn)品設計生產(chǎn)工藝流程課件
- 《概率論與數(shù)理統(tǒng)計》-教學教案
- 四年級下冊信息技術(shù)課件-14.西游故事人物記演示文稿|冀教版(共17張PPT)
- 調(diào)機品管理規(guī)定
- 員工證書獎勵和補貼管理辦法
- DB45∕T 396-2022 膨脹土地區(qū)建筑技術(shù)規(guī)程
- 300萬噸勝利原油常減壓裝置設計
- 部編人教版五年級上冊語文閱讀理解及答案(考題)
- DB51∕T 2866-2022 公共機構(gòu)合同能源管理與服務規(guī)范
- 300MW燃煤機組A級檢修費用定額
評論
0/150
提交評論