freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

c面向?qū)ο髮嵗}集錦(編輯修改稿)

2025-04-20 04:50 本頁面
 

【文章內(nèi)容簡介】 0。19. }。20. voidStudent::getdata()21. {22. coutInputnumber:。23. cinnumber。24. coutInputname:。25. cinname。26. coutInputdegreeofmath:。27. cin。28. coutInputdegreeofenglish:。29. cin。30. coutInputdegreeofphysics:。31. cin。32. }33. voidStudent::showdata()34. {35. cout=========分割線=======endl。36. coutNumber:numberendl。37. coutName:nameendl。38. coutMathendl。39. coutEnglish:endl。40. coutPhysics:endl。41. }42. intmain()43. {44. Students1。45. ()。46. ()。47. return0。48. }includeiostreamincludestringusing namespace std。class Student { public: void getdata()。 void showdata()。 private: string number。 string name。 class Cdegree { public: double math。 double english。 double phy。 }degree。 }。void Student::getdata() { coutInput number:。 cinnumber。 coutInput name:。 cinname。 coutInput degree of math:。 cin。 coutInput degree of english:。 cin。 coutInput degree of physics:。 cin。 }void Student::showdata(){ cout=========分割線=======endl。 coutNumber:numberendl。 coutName:nameendl。 coutMathendl。 coutEnglish:endl。 coutPhysics:endl。 }int main(){ Student s1。 ()。 ()。 return 0。}結(jié)果輸出:[cpp] view plaincopyprint?1. Inputnumber:0072. Inputname:qianshou3. Inputdegreeofmath:894. Inputdegreeofenglish:995. Inputdegreeofphysics:1006. =========分割線=======7. Number:0078. Name:qianshou9. Math8910. English:9911. Physics:100C++面向?qū)ο箢惖膶嵗}目八 題目描述:編寫一個程序輸入3個學(xué)生的英語和計算機成績,并按照總分從高到低排序。要求設(shè)計一個學(xué)生類Student,其定義如下:程序代碼:[cpp] view plaincopyprint?1. includeiostream2. usingnamespacestd。3. classStudent4. {5. public:6. voidgetscore()。//獲取一個學(xué)生成績7. voiddisplay()。//顯示一個學(xué)生成績8. voidsort(Student*)。//將若干個學(xué)生按總分從高到低排序9. private:10. intenglish。11. intputer。12. inttotal。13. }。14. voidStudent::getscore()15. {16. cout請輸入該學(xué)生的英語成績:。17. cinenglish。18. cout請輸入該學(xué)生的計算機成績:。19. cinputer。20. total=english+puter。21. }22. voidStudent::display()23. {24. cout該學(xué)生的英語成績?yōu)椋篹nglish,計算機成績?yōu)椋簆uter,總分為:totalendl。25. }26. voidStudent::sort(Student*p)27. {28. if(ptotaltotal)//p指向的對象比該對象大的時候,則交換對象的值29. {30. intt1,t2,t3。31. t1=penglish。32. penglish=english。33. english=t1。34. t2=pputer。35. pputer=puter。36. puter=t2。37. t3=ptotal。38. ptotal=total。39. total=t3。40. }41. }42. intmain()43. {44. Studentst[3]。45. for(inti=0。i3。i++)46. {47. st[i].getscore()。48. st[i].display()。49. }50. st[0].sort(amp。st[1])。51. st[0].sort(amp。st[2])。52. st[1].sort(amp。st[2])。53. cout======================endl。54. cout排序結(jié)果如下:endl。55. for(inti=0。i3。i++)56. {57. st[i].display()。58. }59. }輸出結(jié)果:[cpp] view plaincopyprint?1. 請輸入該學(xué)生的英語成績:802. 請輸入該學(xué)生的計算機成績:903. 該學(xué)生的英語成績?yōu)椋?0,計算機成績?yōu)椋?0,總分為:1704. 請輸入該學(xué)生的英語成績:705. 請輸入該學(xué)生的計算機成績:606. 該學(xué)生的英語成績?yōu)椋?0,計算機成績?yōu)椋?0,總分為:1307. 請輸入該學(xué)生的英語成績:998. 請輸入該學(xué)生的計算機成績:879. 該學(xué)生的英語成績?yōu)椋?9,計算機成績?yōu)椋?7,總分為:18610. ======================11. 排序結(jié)果如下:12. 該學(xué)生的英語成績?yōu)椋?9,計算機成績?yōu)椋?7,總分為:18613. 該學(xué)生的英語成績?yōu)椋?0,計算機成績?yōu)椋?0,總分為:17014. 該學(xué)生的英語成績?yōu)椋?0,計算機成績?yōu)椋?0,總分為:130C++面向?qū)ο箢惖膶嵗}目九 題目描述:編寫一個學(xué)生和老師數(shù)據(jù)輸入和顯示程序,學(xué)生數(shù)據(jù)有編號、姓名、班號和成績,教師數(shù)據(jù)有編號、姓名、職稱和部門。要求將編號、姓名、輸入和顯示設(shè)計成一個類person,并作為學(xué)生數(shù)據(jù)操作類student和教師數(shù)據(jù)操作類teacher的基類。程序代碼:[cpp] view plaincopyprint?1. includeiostream2. includestring3. usingnamespacestd。4. classPerson5. {6. public:7. voidget()8. {9. cout請輸入編號:。10. cinnumber。11. cout請輸入姓名:。12. cinname。13. }14. voidshow()15. {16. coutNO.numberendl。17. coutname:nameendl。18. }19. private:20. stringnumber。21. stringname。22. }。23. classStudent:publicPerson24. {25. public:26. voidget()27. {28. Person::get()。29. cout請輸入班級編號:。30. cinclass_number。31. cout請輸入成績:。32. cingrade。33. }34. voidshow()35. {36. Person::show()。37. coutclass_number:class_numberendl。38. coutgrade:gradeendl。39. }40. private:41. stringclass_number。42. floatgrade。43. }。44. classTeacher:publicPerson45. {46. public:47. voidget()48. {49. Person::get()。50. cout請輸入職稱:。51. cintitle。52. cout請輸入部門:。53. cindepartment。54. }55. voidshow()56. {57. Person::show()。58. couttitle:titleendl。59.
點擊復(fù)制文檔內(nèi)容
教學(xué)教案相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1