011:Big & Base 封闭类问题

#include <iostream>
#include <string>
using namespace std;
class Base {
public:
	int k;
	Base(int n) :k(n) { }
};
class Big
{
public:
	int v;
	Base b;
	// 在此处补充你的代码
	Big(int n) :b(n)
	{
		v = n;
	}
};
int main()
{
	int n;
	while (cin >> n) {
		Big a1(n);
		Big a2 = a1;
		cout << a1.v << "," << a1.b.k << endl;
		cout << a2.v << "," << a2.b.k << endl;
	}
}

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页