#include using namespace std; class Human { public: Human(){cout<<"构造Human\n";} virtual void smart(){} virtual void beautiful(){} virtual ~Human(){cout<<"析构Human\n";} }; class father: virtual public Human { public: father(){cout<<"构造father\n";} virtual void smart() { cout<<"父亲很聪明\n"; } //virtual void beautiful(){} virtual ~father(){cout<<"析构father"<>choice; switch(choice) { case 0:quit=true; break; case 1:p=new father; p->beautiful(); delete p; break; case 2:p=new son; p->beautiful(); p->smart(); delete p; break; case 3:p=new mother; p->beautiful(); delete p; break; default:cout<<"请输入从0到2之间的数字。"; break; } if (quit) { break; } } cout<<"程序结束"<