64,646
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
//男人类
class boy
{
public: //他敞开胸怀
void LoveYou()
{
cout << "Jessica, I love you, marry me!" << endl;
}
void KissYou()
{
cout << "Jessica, you are too sexy, I want to kiss you..." << endl;
}
};
//上帝说女人是男人的肋骨做的,所以女人就由男人派生出来吧……
class girl : public boy
{
public: //她也敞开胸怀……我什么都没看见 -_-!
void LoveYou()
{
cout << "I love you too...But I am too shy to say..." << endl;
}
void KissYou()
{
cout << "You do what you want..." << endl;
}
};
void main(void)
{
boy A1Pass; //一个男孩叫A1Pass ^_^
girl Jessica; //一个女孩叫杰西卡
boy *the_A1Pass_home = &Jessica;
girl *the_Jessica_home = &Jessica;
//////////////////////////////////////////
//------他们在干什么呀?请写出结果---------
the_A1Pass_home ->LoveYou();
the_Jessica_home->LoveYou();
the_A1Pass_home ->KissYou();
the_Jessica_home->KissYou();
//////////////////////////////////////////
}