### 题目描述

#include <iostream>
using namespace std;
class A
{
protected:
int x;
public:
A(int a)
{
x=a;
}
};

//***************begin*****************
class B: ___(1)_____ A
{
protected:
int y;
public:
B(int a,int b):A(a)
{
y=b;
}
};

class C:___(2)_____A
{
protected:
int z;
public:
C(int a,int b):A(a)
{
z=b;
}
};

class D: _________(3)__________
{
private:
int t;
public:
D(int a, int b, int c, int d):_________(4)___________{}
void output()________(5)_________
};
//***************end*****************
void D::output()
{
cout<<"x from A: "<<x<<endl;
cout<<"y from B: "<<y<<endl;
cout<<"z from C: "<<z<<endl;
cout<<"t from D: "<<t<<endl;
}

int main( )
{
int a, b, c, d;
cin>>a>>b>>c>>d;
D x(a,b,c,d);
x.output();
return 0;
}

### 输入

4个整数，将在D类对象的构造函数中，分别初始化来自几个类中的数据成员

1 2 3 4

x from A: 1
y from B: 2
z from C: 3
t from D: 4

### 代码如下

``````#include<stdio.h>
int main()
{
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
printf("x from A: %d
",a);
printf("y from B: %d
",b);
printf("z from C: %d
",c);
printf("t from D: %d
",d);
return 0;
}``````