其他分享
首页 > 其他分享> > 011 Big & Base 封闭类问题

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):v(n),b(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;
	}
}

标签:int,Big,a1,011,Base,include,public
来源: https://www.cnblogs.com/icefield817/p/15914029.html