下面程序的运行结果是( )。
#include
classbase{
protected:
inta;
public:
base(){cout<<"0";}
};
classbasel:virtualbase{
public:
basel(){cout<<"1";}
};
classbase2:virtualbase{
public:
base2(){cout<<"2";}
};
classderived:publicbasel,publicbase2{
public:
derived(){cout<<"3";}
};
voidmain()
{
derivedobj;
eout<
}
发布于 2022-05-13 21:34:21
登录后免费查看答案
关注者
0
被浏览
15