在c++中定义类
class 类名{
public:
//属性
属性列表;
//方法
函数列表;
};
class Plane{
public:
int hp;
int px,py;
int price;
string name;
void fly()
{
....
}
void fire(int x,int y)
{
...
}
};
class 类名{
public:
//属性
属性列表;
//方法
函数列表;
};
class Plane{
public:
int hp;
int px,py;
int price;
string name;
void fly()
{
....
}
void fire(int x,int y)
{
...
}
};