|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
I Like Mai Forever!
- #include<iostream>
- #include<string>
- class Lovers
- {
- friend class Others;
- public:
- Lovers(std::string theName);
- void hug(Lovers *lovers);
- void hold_hands(Lovers *lovers);
- void mating(Lovers *lovers);
- void kiss(Lovers *lovers);
- private:
- std::string name;
- };
- Lovers::Lovers(std::string theName)
- {
- name=theName;
- }
- class Boyfriend:public Lovers
- {
- public:
- Boyfriend(std::string theName);
- };
- Boyfriend::Boyfriend(std::string theName):Lovers(theName)
- {
- }
- class Girlfriend:public Lovers
- {
- public:
- Girlfriend(std::string theName);
- };
- Girlfriend::Girlfriend(std::string theName):Lovers(theName)
- {
- }
- class Others
- {
- public:
- std::string name;
- Others(std::string theName);
- void mating(Lovers *lovers);
- };
- Others::Others(std::string theName)
- {
- name=theName;
- }
- class Sexfriend:public Others
- {
- public:
- Sexfriend(std::string theName);
- };
- Sexfriend::Sexfriend(std::string theName):Others(theName)
- {
- }
- void Lovers::hold_hands(Lovers *lovers)
- {
- std::cout<<name<<" hold hands with "<<lovers->name<<std::endl;
- }
- void Others::mating(Lovers *lovers)
- {
- std::cout<<name<<" mating with "<<lovers->name<<std::endl;
- }
- int main()
- {
- Boyfriend bf("Sakuta");
- Girlfriend gf("Mai");
- Others ntr("I");
- bf.hold_hands(&gf);
- ntr.mating(&gf);
- return 0;
- }
复制代码
第一次发学习笔记,不知道标题有没有违规哈:) |
|