#include <iostream>
#include <string>
using namespace std;
class Student
{
private:
	int num;
	string name;
	char sex;
public:
	void display()                              //定义输出函数display
	{
		cout<<"num: "<<num<<endl;
		cout<<"name: "<<name<<endl;
		cout<<"sex: "<<sex<<endl;
	}
};
class NewStudent:private Student                  //建立私有继承的派生类
{
private:
	int age;                                  //增加数据成员age
	string addr;                               //增加数据成员addr
public:
	void input()                              //定义输入函数input
	{
		cout<<"please input age and addr"<<endl;
		cin>>age;
		cin>>addr;
	}
	void new_display()                        //在派生类中定义输出函数new_display
	{
		cout<<"age: "<<age<<endl;
		cout<<"addr: "<<addr<<endl;
	}
};
int main()
{
	NewStudent t;
	t.input();                                //调用派生类中的成员函数input
	t.new_display();						   //调用派生类中的成员函数new_display
	return 0;
}

