求助关于多个类的 c++ 程序
#include<iostream>using namespace std;
class Anmial
{
public:
virtual void color()=0;
virtual void weight()=0;
~Anmial()
};
class dog:public Anmial
{
public:
void color();
void weight();
~dog()
};
class bird:public Anmial
{
public:
void color();
void weight();
~bird()
};
class cat:public Anmial
{
public:
void color();
void weight();
~cat()
};
#include<dog.h>
void dog::color()
{
cout<<"狗的毛色:黑色"<<endl;
}
void dog::weight()
{
cin>>weight;
cout<<"狗的体重:"<<weight<<endl;
}
#include<bird.h>
void bird::color()
{
cout<<"鸟的毛色:黄色"<<endl;
}
void bird::weight()
{
cin>>weight;
cout<<"鸟的体重:"<<weight<<endl;
}
#include<cat.h>
void cat::color
{
cout<<"猫的毛色"<<endl;
}
void cat::weight()
{
cin>>weight;
cout<<"猫的体重:"<<weight<<endl;
}
void main()
{
}
希望把这个程序改成含有多重继承,运算符重载,静态变量,虚函数,构造、析构函数的程序