#include <iostream>

class cat{
    public:
        cat(){
            std::cout<<"cat"<<std::endl;
        }
        ~cat(){
            std::cout<<"cat distructor"<<std::endl;
        }
        
        void sd(){
            std::cout<<"sd"<<std::endl;
        }
};

class dog{
    public:
        dog(){
            std::cout<<"dog"<<std::endl;
        }
        ~dog(){
            std::cout<<"dog distructor"<<std::endl;
        }
        
        void dd(){
            std::cout<<"dd"<<std::endl;
        }
};

class animal : public dog, public cat{
    public:
        animal(){
            std::cout<<"animal"<<std::endl;
        }
        ~animal(){
            std::cout<<"animal distructor"<<std::endl;
        }

        void aa(){
            std::cout<<"aa"<<std::endl;   
        }
};

int main() {
    animal a;

    a.sd();
    a.dd();
    a.aa();
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: