#include <iostream>
#include <string>
using namespace std;
class Student
{
private:
	int num;
	string name;
	string sex;
public:
	void display();                              //声明成员函数
	Student(int n,string n1,string s);                 //声明带参数的构造函数
	~Student();                                //声明析构函数
};
int main()
{
	Student t1(500,"zhang_san","man");            //定义对象t1，对t1中数据成员赋值
	t1.display();                               //调用函数display
	Student t2(501,"li_si","woman");              //定义对象t2，对t2中的数据成员赋值
	t2.display();                               //调用函数display
	return 0;
}
void Student::display()                           //定义成员函数display
{
	cout<<"num: "<<num<<endl;
	cout<<"name: "<<name<<endl;
	cout<<"sex: "<<sex<<endl;
}
Student::Student(int n,string n1,string s)                //定义构造函数
{
	num=n;
	name=n1;
	sex=s;
}
Student::~Student()                               //定义析构函数
{
	cout<<"输出析构函数 "<<endl;
}


