#include"iostream.h" class CShape { public: virtual float area()=0; //纯虚函数的建立 }; class CTriangle:public CShape { public: CTriangle(float h,float w) { H=h; W=w; } float area() //在派生类中定义虚函数的具体实现代码 { return (float) (H*W*0.5);} private: float H,W; }; class CCircle:public