创建一个类,并用公有化继承,输出子类
class A
{
public:
void drow(){return num;}
void cin_x(int num){this->num=num;}
private:
int num;
};
class B:public A
{
pubilc:
void cout_x(){cout<<num<<endl;}
}
int main(void)
{
A a;
B b;
int num;
cin>>num;
a.cin_x(num);
b.cout();
}