CS计算机代考程序代写 #include
#include
using namespace std;
class V {
int i;
public:
V() { cout << "in V::V()
"; };
V(int i) : i(i){ cout << "in V::V(int)
"; }
};
class A : virtual public V {
public:
A() { cout << "in A::A()
"; };
A(int i) : V(i) { cout << "in A::A(int)
"; }
};
class B : virtual public V {
public:
B(){ cout << "in B::B()
"; };
B(int i) : V(i) { cout << "in B::B(int)
"; }
};
class C : public A, B {
public:
C(){ cout << "in C::C()
"; };
C(int i) : A(i), B(i) { cout << "in C::C(int)
"; }
};
class D : virtual public V {
public:
D() { cout << "in D::D()
"; }
D(int i) : V(i) { cout << "in D::D(int)
"; }
};
class E : public C, D {
public:
E() { cout << "in E::E()
"; }
E(int i) : V(i), C(i), D(i) { cout << "in E::E(int)
"; }
};
int main(){
E e1(2);
E e2;
int i; cin >> i;
return 0;
}