?? lab7_3.cpp
字號:
#include <iostream>
using namespace std;
class vehicle
{
private:
int MaxSpeed;
int Weight;
public:
vehicle(){MaxSpeed=0; Weight=0;};
~vehicle(){};
void Run() {cout << "Now it is running!" << endl; }
void Stop() {cout << "Now it has stopped!" << endl; }
};
class bicycle : virtual public vehicle
{
private:
int Height;
public:
bicycle(){};
~bicycle(){};
};
class motorcar : virtual public vehicle
{
private:
int SeatNum;
public:
motorcar(){};
~motorcar(){};
};
class motorcycle : public bicycle , public motorcar
{
public:
motorcycle (){};
~motorcycle (){};
};
void main()
{
motorcycle a;
a.Run();
a.Stop();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -