學(xué)校運動會管理系統(tǒng)_第1頁
學(xué)校運動會管理系統(tǒng)_第2頁
學(xué)校運動會管理系統(tǒng)_第3頁
學(xué)校運動會管理系統(tǒng)_第4頁
學(xué)校運動會管理系統(tǒng)_第5頁
已閱讀5頁,還剩2頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、【源代碼】#include#includeusing namespace std;#define N 10class Student /每個學(xué)生的信息public:char name10;char sex;char college10;char item10;int position;int score;void menu(); /全局函數(shù)聲明Student stuN; /實例化出一個對象數(shù)組void writein() /輸入學(xué)生信息 int i,n,M,W;coutn;coutM; coutW; cout輸入完畢!請繼續(xù)輸入?yún)①悓W(xué)生信息:endl; /初始化輸入 coutendl;for(

2、i=0;iN;i+); loop_1:coutstui.sex;if(stui.sex!=m&stui.sex!=w)cout性別輸入錯誤!endl; goto loop_1; coutstui.college; coutstui.item;coutstui.position;coutstui.score; coutendl;coutendl; cout輸入完畢!請選擇下一步操作:endl;menu(); /主菜單函數(shù)調(diào)用void search() /查詢信息int m;void search_college(); /按學(xué)院查詢的函數(shù)聲明void search_ite

3、m(); /按項目查詢的函數(shù)聲明void search_name(); /按姓名查詢的函數(shù)聲明cout請選擇查詢方式:endl;cout*1、按院系查詢*endl; cout*2、按項目查詢*endl;cout*3、按姓名查詢*endl;cout*4、返回主菜單*endl;coutendl;cout=endl;coutm;if(m=1)search_college(); /按學(xué)院查詢的函數(shù)else if(m=2)search_item(); /按項目查詢的函數(shù)else if(m=3)search_name(); /按名字查詢的函數(shù)else if(m=4)menu(); /返回主菜單elseco

4、ut請輸入正確的序號!endl;search(); /錯誤提示并返回查詢菜單void search_college() /按學(xué)院查詢int a,m_score=0,w_score=0,sum=0,flag;Student s;couts.college;cout姓名 性別 參賽項目 名次 得分endl; for(a=0;aN;a+)if(strcmp(s.college,stua.college)=0) /調(diào)用student類的對象if(stua.sex=m)m_score+=stua.score; stua.sex stua.item stua.position s

5、tua.scoreendl;elsew_score+=stua.score; stua.sex stua.item stua.position stua.scoreendl;flag=1;if(flag!=1)cout對不起,該學(xué)院沒有參加運動會!請重新輸入!endl;search();sum=m_score+w_score;cout該學(xué)院總分:sumendl;cout男子得分:m_scoreendl;cout女子得分:w_scoreendl;cout=endl;coutendl;cout請選擇下一步操作:endl;search();void search_item

6、() /按項目查詢int b,flag;Student x;coutx.item;cout姓名 性別 院系 名次 得分endl; for(b=0;bN;b+)if(strcmp(x.item,stub.item)=0) /調(diào)用student類的對象 stub.sex stub.college stub.position stub.scoreendl;flag=1;if(flag!=1)cout對不起,沒有該項目!請重新輸入!endl;search();cout=endl;coutendl;cout請選擇下一步操作:endl;search();void search_n

7、ame() /按姓名查詢int c,flag;Student y;;cout性別 院系 參賽項目 名次 得分endl; for(c=0;cN;c+)if(strcmp(,)=0) /調(diào)用student類的對象coutstuc.sex stuc.college stuc.item stuc.position stuc.scoreendl;flag=1;if(flag!=1)cout對不起,該學(xué)生沒有參加運動會!請重新輸入!endl;search();cout=endl;coutendl;cout請選擇下一步操作:endl;search();voi

8、d exit() cout* * * * * * * * * * * * * * * * * *endl;cout * * * * * * * * * * * * * * *endl;cout * * * * * * * * * * * * * * * *endl; cout * * * * * * * * * * * * *endl;cout * * * * * * * * * * * * * * *endl; cout * * * * * * * * * * * * * *endl; cout * * * * * * * * * * * * * * * * * *endl; coutend

9、l; void menu() /主菜單int n;coutendl;cout=歡迎使用學(xué)校運動會管理系統(tǒng)=endl;coutendl;cout*1.輸入信息*endl;cout*2.查詢信息*endl;cout*3.退出系統(tǒng)*endl;coutendl;cout=endl;coutn;if(n=1)writein();else if(n=2)search();else if(n=3)exit();exit(0);elsecout請輸入正確的序號!endl;menu();void welcome()char y5; cout *endl; cout * # # # *endl; cout * #

10、 # # # # # # # # # # # *endl; cout * # # # # # # # # # # # # # # # # # # # # # # # *endl; cout * # # # # # # # # # # # # # # # # # # # *endl; cout * # # # # # # # # # # # # # # # # # *endl; cout * # # # # # # # # # # # # # # # *endl; cout * # # # # # # # # # # # # *endl; cout * # # # # # # # # # # # *endl; cout * # # # # # # # # # # # # # #

溫馨提示

  • 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論