#include <iostream>
#include <string>
using namespace std;
class A                                        //定义基类A
{
protected:
	int value;
public:
	A(){}
	void setvalue(int m)
	{
		value=m;
	}
	int getvalue()const
	{
		return value;
	}
};
class B:virtual public A                           //定义派生类B
{
public:
	B(){}
};
class C:virtual public A                           //定义派生类C
{
public:
	C(){}
}; 
class D:public B,public C                          //定义派生类D
{
public:
	D():B(),C(){}
};
int main()
{
	D t;
	t.setvalue(10);
	cout<<t.getvalue()<<endl;
	return 0;
}

