第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

有什么問題?就是運(yùn)行不了

有什么問題?就是運(yùn)行不了

C++
慕田峪3750655 2016-09-27 14:45:47
#include?<iostream> #include?<cstdlib> #include?<ctime> #include?<typeinfo> using?namespace?std; class?Grand { private: int?hold; public: Grand(int?h?=?0)?:hold(h){} virtual?void?Speak()?const{?cout?<<?"I?am?a?grand?class!\n";?} virtual?int?Value()?const{?return?hold;?} }; class?Superb?:public?Grand { public: Superb(int?h?=?0)?:Grand(h){} void?Speak()?const{?cout?<<?"I?am?a?superb?class!!\n";?} virtual?void?Say()?const { cout?<<?"I?hold?the?superb?value?of?"?<<?Value()?<<?"!\n"; } }; class?Magnificent?:public?Superb { private: char?ch; public: Magnificent(int?h?=?0,?char?cv?=?'A')?:Superb(h),?ch(cv){} void?Speak()?const{?cout?<<?"I?am?a?magnificent?class!!!\n";?} void?Say()?const{ cout?<<?"I?hold?the?character?"?<<?ch?<< "?and?the?integer?"?<<?Value()?<<?"!\n"; } }; Grand?*?GetOne(); int?main() { srand(time(0)); Grand?*?pg; Superb?*?ps; for?(int?i?=?0;?i?<?5;?i++) { pg?=?GetOne(); cout?<<?"Now?processing?type?"?<<?typeid(*pg).name()?<<?".\n"; pg->Speak(); if?(ps?=?dynamic_cast<Superb?*>(pg)) ps->Say(); if?(typeid(Magnificent)?==?typeid(*pg)) cout?<<?"Yes,?you're?really?magnificent.\n"; } return?0; } Grand?*?GetOne() { Grand?*?p; switch?(rand()?%?3) { case?0:?p?=?new?Grand(rand()?%?100); break; case?1:?p?=?new?Superb(rand()?%?100); break; case?2:?p?=?new?Magnificent(rand()?%?100,?'A'?+?rand()?%?26); break; } return?p; }
查看完整描述

1 回答

?
Crafon

TA貢獻(xiàn)63條經(jīng)驗(yàn) 獲得超30個(gè)贊

可以也運(yùn)行啊。。。

查看完整回答
反對(duì) 回復(fù) 2016-09-28
  • 慕田峪3750655
    慕田峪3750655
    warning C4244: “參數(shù)”: 從“time_t”轉(zhuǎn)換到“unsigned int”,可能丟失數(shù)據(jù) error C4703: 使用了可能未初始化的本地指針變量“p”
  • Crafon
    Crafon
    dev cpp運(yùn)行了 Now processing type 5Grand. I am a grand class! Now processing type 11Magnificent. I am a magnificent class!!! I hold the character O and the integer 4! Yes, you're really magnificent. Now processing type 6Superb. I am a superb class!! I hold the superb value of 52! Now processing type 5Grand. I am a grand class! Now processing type 11Magnificent. I am a magnificent class!!! I hold the character B and the integer 97! Yes, you're really magnificent.
  • 1 回答
  • 2 關(guān)注
  • 1106 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)