#include<iostream>
using namespace std;
class base{
int lby;
public:
base(int x){lby=x;cout<<"lby="<<lby<<endl;}
};
class base1:virtual public base
//base为虚基类
{
int a;
public:
base1(int x,int mm):base(x){a=mm;}
};
class base2:virtual public base
//base为虚基类
{
int b;
public:
base2(int x,int z):base(x){b=z;}
};
class b12:virtual public base1,virtual public base2
{
int c;
public:
b12(int x,int mm,int z,int v):base(x),base1(x,mm),base2(x,z){c=v;}
};
class b22:virtual public base1,virtual public base2
{
int d;
public:
b22(int x,int mm,int z,int l):base(x),base1(x,mm),base2(x,z){d=l;}
};
class kk: public b12,public b22
{
public:
kk(int x,int mm,int z,int v,int l):base(x),base1(x,mm),base2(x,z),b12(x,mm,z,v),b22(x,mm,z,l){}
};
//*******************************************************
int main()
{
kk bbb(1999,1,2,3,4);
return 0;
}
写得比较仓促,楼主仔细看看就会明白的