声明一个国家基类Country,包含国名、首都、人口等属性,派生出省类Province,增加省会城市、人口数量属性。定义派生类对象,并对相应信息进行输出。
# include<iostream>
# include<string>
using namespace std;
class Country
{
public:
Country(string nam,string m,i
声明一个国家基类Country,包含国名、首都、人口等属性,派生出省类Province,增加省会城市、人口数量属性。定义派生类对象,并对相应信息进行输出。
# include<iostream>
# include<string>
using namespace std;
class Country
{
public:
Country(string nam,string m,i