

下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、1class shvirtual float class triangle:publicfloath,w; triangle(float float return class rectangle:public1class shvirtual float class triangle:publicfloath,w; triangle(float float return class rectangle:publicrectangle(floath,floatw):triangle(h,w) float area()return class circle:public floatradius; c
2、ircle(float float returnfloat * n)float return sum;void floatsum=total(s,4); 程序的運(yùn)行結(jié)果為#include #include class CTrianglex = y = z = =#include #include class CTrianglex = y = z = =float float returnsqrt(p*(p-a)*(p-b)*(p-floatGetCircumference() return (a+b+c);void CTriangle coutCTriangle#include class c
3、ountersreturncount;void test()counter void counter counter a1,a2,a3; /輸出:25 6 3String(25)Stringclass String(constchar*str=NULL); String(const String &other); String & =(const3String(25)Stringclass String(constchar*str=NULL); String(const String &other); String & =(constStringdeletem_data;/m_dataStri
4、ngString:String(constchar*str) :deletem_data = new *m_data=0; length = m_data = new strcpy(m_data, NULLString:String(const String &other) length=strlen(other.m_data);m_data = new strcpy(m_data, NULLString & if(this=&other) return *this;delete =(const String / 13(1)4/ 3length=strlen(other.m_data); m_
5、data = new charlength+1;strcpy(m_data, NULLreturn (4)/ 3會(huì)看4】虛基類的使用class basecoutthis base 會(huì)看4】虛基類的使用class basecoutthis base classbase2 coutthis classlevel1:public coutthis class coutthis base2base2,virtualpubliclevel1base2,virtualpubliclevel2class toplevel:publiclevel1,virtual publiccoutthisistoplevel void main() to
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 教師在教學(xué)中反思情境的應(yīng)用試題及答案
- 家具設(shè)計(jì)與消費(fèi)心理學(xué)的結(jié)合試題及答案
- 商務(wù)英語學(xué)習(xí)過程中應(yīng)關(guān)注的問題及解決方案試題及答案
- 胸外按壓填空試題及答案
- 戰(zhàn)術(shù)能力土木工程師試題及答案
- 英語知訓(xùn)筆試題及答案
- 代理租賃協(xié)議合同范例
- 物業(yè)管家測(cè)試題及答案
- 打造高分2025年商務(wù)英語考試試題及答案
- 流域生態(tài)環(huán)境綜合治理項(xiàng)目可行性分析
- 高層火災(zāi)撲救要點(diǎn)及注意事項(xiàng)
- 消防救援隊(duì)伍微腐敗風(fēng)氣教育
- 2025-2030中國(guó)共軛亞油酸(CLA)行業(yè)市場(chǎng)發(fā)展趨勢(shì)與前景展望戰(zhàn)略研究報(bào)告
- 中央2025年中國(guó)知識(shí)產(chǎn)權(quán)研究會(huì)招聘筆試歷年參考題庫(kù)附帶答案詳解
- 10《奪取抗日戰(zhàn)爭(zhēng)和人民解放戰(zhàn)爭(zhēng)的勝利》第一課時(shí)《勿忘國(guó)恥》教學(xué)設(shè)計(jì)-2023-2024學(xué)年道德與法治五年級(jí)下冊(cè)統(tǒng)編版
- 江蘇省新高考基地學(xué)校2024-2025學(xué)年高三下學(xué)期第二次大聯(lián)考化學(xué)試卷(含答案)
- 試崗期協(xié)議書模板
- 檔案法律法規(guī)知識(shí)試題及答案
- 第四單元《比例尺》(單元設(shè)計(jì)教案)-2024-2025學(xué)年六年級(jí)下冊(cè)數(shù)學(xué)青島版
- 2025人教版七年級(jí)下冊(cè)生物期末學(xué)業(yè)質(zhì)量檢測(cè)試卷(含答案)
- 2024年同等學(xué)力申碩《英語》試題真題及答案
評(píng)論
0/150
提交評(píng)論