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

正文內(nèi)容

c課程設(shè)計(jì)--設(shè)計(jì)菜單選擇程序-閱讀頁

2025-06-23 04:49本頁面
  

【正文】 ==a[k].num) cout輸入編號(hào)重復(fù) !endl。 cina[n].name。kn。 } cout請(qǐng)輸入性別 (f 為女, m 為男 ): 。 if(a[n].sex!=39。amp。a[n].sex!=39。) { cout性別輸入錯(cuò)誤 。 cina[n].sex。 cina[n].age。n) { if(nMAX) { for (int i=0。i++) { x[i].name=y[i].name。 } return 1。 } //////////////// ////////////////// float printer(worker *p, int amp。in。 (p+i)display()。 return 0。 六、 參考文獻(xiàn) [1] 姚全珠 . C++面向?qū)ο蟪绦蛟O(shè)計(jì) [M]. 北京:電子工業(yè)出版社, 2021. [2] 鄭莉 .C++語言程序設(shè)計(jì) [M].北京 :清華大學(xué)出版社 ,2021. 一、 實(shí)習(xí)題目: 有理數(shù)的四則運(yùn)算 二、 設(shè)計(jì)思想: 本程序中主要用到了一下這幾個(gè)函數(shù): 構(gòu)造函 數(shù) : Rational(int x1=0,int y1=1){x=x1。} 重載 ”+” 、 ”” 、 ”*” 、 ”/”四個(gè) 運(yùn)算符 : Rational operator+(Rational r)。 //重載減法運(yùn)算符 Rational operator*(Rational r)。 //重載除法運(yùn)算符 重載流運(yùn)算 符 : friend istream amp。in,Rational amp。 friend ostream amp。out,Rational amp。 輸入輸出就是按格式構(gòu)造輸出,輸入流需要保證正確的格式 ,要保證分母不等于零。 class Rational //有理數(shù)類 { public: int x。 Rational(int x1=0,int y1=1){x=x1。} Rational operator+(Rational r)。 //重載減法運(yùn)算符 Rational operator*(Rational r)。 //重載除法運(yùn)算符 friend istream amp。in,Rational amp。 //重載輸入運(yùn)算符 friend ostream amp。out,Rational amp。 //重載輸出運(yùn)算符 }。 Rational A,B,C。 cinA。 cinB。 cout\nendl。 cout兩數(shù)之和為 A+B = Cendl。 cout兩數(shù)之差為 AB = Cendl。 cout兩數(shù)之積為 A*B = Cendl。 cout兩數(shù)之商為 A/B = Cendl。 B:cout您是否要繼續(xù) (Y/N)?endl。 coutendl。y39。Y39。 else if (ch==39。||ch==39。) goto C。 C:system(pause)。 } ////////////////////////////////////////////// istream amp。in,Rational amp。 if(==0) { cout分母不能為 0\n。 } ostream amp。out,Rational amp。 float m,n。i1。amp。 n=。 =n。i1。amp。 n=。 =n。 //以分?jǐn)?shù)的形式輸出計(jì)算結(jié)果 return out。 } Rational Rational::operator(Rational r) { return Rational(x**,y*)。 } Rational Rational::operator/(Rational r) { return Rational(x*,y*)。 六、 參考文獻(xiàn) [1] 姚全珠 . C++面向?qū)ο蟪绦蛟O(shè)計(jì) [M]. 北京:電子工業(yè)出版社, 2021. [2] 鄭莉 .C++語言程序設(shè)計(jì) [M].北京 :清華大學(xué)出版社 ,2021.
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1