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

下載本文檔

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

文檔簡(jiǎn)介

1、【源代碼】#include#includeusing namespace std;#define N 10class Student /每個(gè)學(xué)生的信息public:char name10;char sex;char college10;char item10;int position;int score;void menu(); /全局函數(shù)聲明Student stuN; /實(shí)例化出一個(gè)對(duì)象數(shù)組void writein() /輸入學(xué)生信息 int i,n,M,W;coutn;coutM; coutW; cout輸入完畢!請(qǐng)繼續(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性別輸入錯(cuò)誤!endl; goto loop_1; coutstui.college; coutstui.item;coutstui.position;coutstui.score; coutendl;coutendl; cout輸入完畢!請(qǐng)選擇下一步操作:endl;menu(); /主菜單函數(shù)調(diào)用void search() /查詢(xún)信息int m;void search_college(); /按學(xué)院查詢(xún)的函數(shù)聲明void search_ite

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

4、ut請(qǐng)輸入正確的序號(hào)!endl;search(); /錯(cuò)誤提示并返回查詢(xún)菜單void search_college() /按學(xué)院查詢(xún)int a,m_score=0,w_score=0,sum=0,flag;Student s;couts.college;cout姓名 性別 參賽項(xiàng)目 名次 得分endl; for(a=0;aN;a+)if(strcmp(s.college,stua.college)=0) /調(diào)用student類(lèi)的對(duì)象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對(duì)不起,該學(xué)院沒(méi)有參加運(yùn)動(dòng)會(huì)!請(qǐng)重新輸入!endl;search();sum=m_score+w_score;cout該學(xué)院總分:sumendl;cout男子得分:m_scoreendl;cout女子得分:w_scoreendl;cout=endl;coutendl;cout請(qǐng)選擇下一步操作:endl;search();void search_item

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

7、ame() /按姓名查詢(xún)int c,flag;Student y;;cout性別 院系 參賽項(xiàng)目 名次 得分endl; for(c=0;cN;c+)if(strcmp(,)=0) /調(diào)用student類(lèi)的對(duì)象coutstuc.sex stuc.college stuc.item stuc.position stuc.scoreendl;flag=1;if(flag!=1)cout對(duì)不起,該學(xué)生沒(méi)有參加運(yùn)動(dòng)會(huì)!請(qǐng)重新輸入!endl;search();cout=endl;coutendl;cout請(qǐng)選擇下一步操作: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é)校運(yùn)動(dòng)會(huì)管理系統(tǒng)=endl;coutendl;cout*1.輸入信息*endl;cout*2.查詢(xún)信息*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請(qǐng)輸入正確的序號(hào)!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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 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ì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論