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

正文內(nèi)容

c++計(jì)算三角形面積課程設(shè)計(jì)-預(yù)覽頁(yè)

 

【正文】 無(wú)參構(gòu)造函數(shù) Triangle(參數(shù) )。:三角形類型判斷函數(shù) trisave()。:三角形三點(diǎn)的 x 坐標(biāo)和 y 坐標(biāo) Point p1,p2,p3。:主菜單顯示函數(shù) (四)主函數(shù): void display(); switch( int n):調(diào)用操作 四 、程序清單 include include include include include include static int P=2。 Y=y。 //線段類 class Line: public Point//公有繼承點(diǎn)類 { public: Line()//線段類無(wú)參構(gòu)造函數(shù) { X1=0。//給私有數(shù)據(jù)成員賦初值 } Line(double x1,double y1,double x2,double y2):Point(0,0),p1(x1,y1),p2(x2,y2)//線段類帶參構(gòu)造函數(shù),初始化數(shù)據(jù) { X1=x1。 } double linelength()。 double Line::linelength() //定義求兩點(diǎn)距離函數(shù),即三角形的邊長(zhǎng) { return sqrt((X1X2)*(X1X2)+(Y1Y2)*(Y1Y2))。 Y1=0。X2=x2。Y3=y3。//三角形判斷函數(shù) void trisave()。//私有線段類成員 Point p1,p2,p3。 } //調(diào)用三角形類中的成員函數(shù) linelength() 求邊長(zhǎng) double Triangle::triarea() //計(jì)算三角形的面積 8 { double a=()。 return sqrt(p*(pa)*(pb)*(pc))。amp。 else if(a==bamp。 else if(a==b) 9 coutsetiosflags(ios::fixed)setprecision(P) 這 是 一 個(gè) 等 腰 三 角 形 . 腰長(zhǎng)為: b, 底邊長(zhǎng)為:c.endl。 else cout 這 是 一 個(gè) 一 般 銳 角 三 角 形 ,endl 邊 長(zhǎng) 分 別 為 :setiosflags(ios::fixed)setprecision(P)a\tb\tcendl。 cinc。 (,ios::out)。 } void Triangle::triclear() //清空文件中的數(shù)據(jù) { char c。Y39。 ()。 ifstream ftriangle(,ios::binary|ios::nocreate)。 } } else 11 couterror:Cannot open file 39。 coutendl文件數(shù)據(jù)讀取完畢 ! ...\n。 cinx1y1。 cinx3y3。 } void setprecision() //設(shè)置數(shù)據(jù) 的輸出精度 { cout設(shè)置輸出精度 (015): 。 P=n。 cout\t\t\t\t1三角形的判斷 \n。 cout\t\t\t\t5查看存入數(shù)據(jù) \n。 cout\t\t\t 請(qǐng)選擇 (17):。 cinc。:triin(t)。system(pause)。:triin(t)。system(pause)。:triin(t)。break。coutendl。539。break。coutendl。739。coutendl。 } end:cout\n......See you ......\n\n。 調(diào)試實(shí)例: 調(diào)試運(yùn)行開(kāi)始,顯示菜單窗口: 14 輸入 “1”,判斷三角形的類別, (1)依次輸入數(shù)據(jù) 2 4 3 2 4 5 選擇精度 2 回車則出現(xiàn)以下窗口: 說(shuō)明:這是三點(diǎn)能構(gòu)成三角形的時(shí) 15 (2)依次輸入 1 2 3 4 5 6 選擇精度 2 回車則出現(xiàn)如下窗口: (3)依次輸入 1 1 2 1 3 1 選擇精度 2 回車則出現(xiàn)如下界面: 16 (4)當(dāng)依次輸入 1 2 1 5 1 7 選擇精度 3 回車則出現(xiàn)如下 界面: 說(shuō)明:當(dāng)三個(gè)點(diǎn)在同一條直線上時(shí),不能構(gòu)成三角形。分工協(xié)作讓事情從大變小,能更好的發(fā)揮各人的長(zhǎng)處。
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1