5.8

#include<iostream>

using namespace std;

#include<string>

class mother {

public:

    mother()

    {

        cout << "mother\n";

    }

};

class daughter : public mother {

public:

    daughter()

    {

        cout << "daughter\n";

    }

};

class son : public mother {

public:

    son()

    {

        cout << "son\n";

    }

};

int main()

{

    daughter cynthia;

    son daniel;

    return 0;

}

posted @ 2023-05-08 21:18  张佳木  阅读(74)  评论(0)    收藏  举报