#include <cstdlib>
#include <iostream>
#include <string>

using namespace std;

class aliment
{
 private :
         string _name;
 public :
        aliment(string nom):_name(nom)
        {}
        
        aliment(const aliment& al):_name(al._name)
        {}
        
        ~aliment()
        {}
        
        friend ostream& operator<<(ostream &os, const aliment &al)
        {
            return (os << al._name);
        }
};

class animal
{
 protected :
         string _name;
 public :
        animal() {}
        virtual ~animal() {}
        virtual void seDeplacer()=0;
        virtual void seReproduire()=0;
        virtual string what()=0;

        void manger(aliment al)
        {
            cout << what() << " mange un " << al << endl;
        }
        
        friend ostream& operator<<(ostream &os,  animal& a)
        {
         return (os << a.what());
        }
};

class mammifere : public animal
{
 public :
        void seReproduire()
        {
         cout <<"mise bas" << endl;
        }
};

class reptile : public animal
{
 public :
        void seReproduire()
        {
         cout <<"ponte" << endl;
        }
        
};

class oiseau : public animal
{
 public : void seReproduire()
          {
           cout << "ponte" << endl;
          }
};

class lion : public mammifere
{
 public :
        lion(string nom)
        {
         _name = nom;
        }
        
        ~lion() {}
        
        void seDeplacer()
        {
         cout << "marche à quatre pattes" << endl;
        }
        
        string what()
        {
         return _name+" le lion";
        }
};

class serpent : public reptile
{
 public :
        serpent(string nom)
        {
         _name = nom;
        }
        
        ~serpent(){}
        
        void seDeplacer()
        {
         cout << "rampe" << endl;
        }
        
         string what()
        {
         return _name+" le serpent";
        }
};

int main(int argc, char *argv[])
{
    animal *zoo[10];
    
    aliment al("biscuit");
    
    zoo[0] = new lion("simba");
    zoo[1] = new serpent("hiviss");
    
    cout << *zoo[0] << endl;

    zoo[1]->manger(al);

    system("PAUSE");
    return EXIT_SUCCESS;
}
