从bicycle和motorcar派生出摩托车(motorcycle)类,在继承过程中,注意把vehicle设置为虚基类。...<< endl;
}
};
class motorcycle :public bicycle, public motorcar {
public:
motorcycle(double m..., double w, double h, double n) :vehicle(m, w), bicycle(m, w, h), motorcar(m, w, n) {
}
~motorcycle...() {
}
void Run() {
cout << "This is a motorcycle:" << endl;
cout << "MaxSpeed...15.2, 36);
t2.Run();
t2.Stop();
motorcar t3(13, 65, 33);
t3.Run();
t3.Stop();
motorcycle