#include <iostream>
#include <cstring>
using namespace std;
class Vehicle
{
public:
Vehicle()
{
cout<<"Vehicle default.\n";
cnt++;
}
Vehicle(int s)
{
cnt++;
speed=s;
cout<<"Vehicle no-default.\n";
}
Vehicle(const Vehicle& another)
{
speed=another.speed;
cout<<"Vehicle copier.\n";
cnt++;
}
void show()
{
cout<<speed;
}
void setSpeed(int _speed)
{
speed=_speed;
}
static int getCnt()
{
return cnt;
}
protected:
int speed;
static int cnt;
};
int Vehicle::cnt=0;
class Car:public Vehicle
{
public:
Car()
{
cout<<"Car default\n";
}
Car(const Car &another):Vehicle(another)
{
persons=another.persons;
cout<<"Car copier\n";
}
Car(int _persons, int _speed){persons=_persons;Vehicle::setSpeed(_speed);}
void show()
{
Vehicle::show();
cout<<persons<<endl;
}
private:
int persons;
};
int main()
{
Car car(5,120);
cout<<Car::getCnt()<<endl;
return 0;
}