指导书

#include <iostream>

using namespace std;

class mother {

public:

    mother()

    {

        cout << "mother\n";

    }

};

class daughter : public mother {

public:

    daughter() :mother()

    {

        cout << "daughter\n";

    }

}; class son : public mother {

public:

    son() :mother()

    {

        cout << "son\n";

    }

};

int main()

{

    daughter cynthia;

    son daniel;

    return 0;

}

posted @ 2024-01-24 22:16  平安喜乐×  阅读(46)  评论(0)    收藏  举报