#include <iostream>
#include <cstdlib>
using namespace std;
class ClassA
{
public:
ClassA(int);
void print();
protected:
int plus;
};
class ClassB: public ClassA
{
public:
ClassB(int,int);
void print();
void count();
private:
int minus;
};
ClassA::ClassA(int PLUS)
{
plus=PLUS;
}
void ClassA::print()
{
cout << plus << endl;
}
//////////////////////////////////////////////////////
ClassB::ClassB(int PLUS, int MINUS) : ClassA(PLUS)
{
minus=MINUS;
}
void ClassB::print()
{
ClassA::print();
cout << minus << endl;
}
void ClassB::count()
{
++plus;
--minus;
}
int main()
{
ClassB b(5,5);
b.print();
b.count();
b.print();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGxpYj4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIENsYXNzQQp7CiAgICBwdWJsaWM6CiAgICAgICAgQ2xhc3NBKGludCk7CiAgICAgICAgdm9pZCBwcmludCgpOwogICAgcHJvdGVjdGVkOgogICAgICAgIGludCBwbHVzOwp9OwpjbGFzcyBDbGFzc0I6IHB1YmxpYyBDbGFzc0EKewogICAgcHVibGljOgogICAgICAgIENsYXNzQihpbnQsaW50KTsKICAgICAgICB2b2lkIHByaW50KCk7CiAgICAgICAgdm9pZCBjb3VudCgpOwogICAgcHJpdmF0ZToKICAgICAgICBpbnQgbWludXM7Cn07CkNsYXNzQTo6Q2xhc3NBKGludCBQTFVTKQp7CiAgICBwbHVzPVBMVVM7ICAgICAgCn0Kdm9pZCBDbGFzc0E6OnByaW50KCkKewogICAgY291dCA8PCBwbHVzIDw8IGVuZGw7ICAgIAp9Ci8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLwpDbGFzc0I6OkNsYXNzQihpbnQgUExVUywgaW50IE1JTlVTKSA6IENsYXNzQShQTFVTKQp7CiAgICBtaW51cz1NSU5VUzsgICAgICAKfQp2b2lkIENsYXNzQjo6cHJpbnQoKQp7CiAgICBDbGFzc0E6OnByaW50KCk7CiAgICBjb3V0IDw8IG1pbnVzIDw8IGVuZGw7ICAgIAp9CnZvaWQgQ2xhc3NCOjpjb3VudCgpCnsKICAgICsrcGx1czsKICAgIC0tbWludXM7Cn0KaW50IG1haW4oKQp7CiAgICBDbGFzc0IgYig1LDUpOwogICAgYi5wcmludCgpOwogICAgCiAgICBiLmNvdW50KCk7CiAgICBiLnByaW50KCk7CiAgICByZXR1cm4gMDsKfSA=