#include<iostream.h>
#include<string.h>
 class date
{
 public:
  date(int a,int b,int c);
  date(date &p);
  ~date();
  void display(void);
  void set(int a,int b,int c);
 private:
  int year;
  int month;
  int day;
};
 class employee
{
 public:
  employee(int a,char b[],char c,int d,int e,int f,int g);
  employee(employee &p);
  ~employee();
  void display(void);
  void modify(void);
 private:
  int no;
  char name[20];
  char sex;
  int salary;
  date b_day;
};
 employee::employee(int a,char b[],char c,int d
	       ,int e,int f,int g):b_day(e,f,g)
{
 no=a;
 strcpy(name,b);
 sex=c;
 salary=d;
 cout<<"职员对象创建"<<endl;
}
 employee::employee(employee &p):b_day(p.b_day)
{
 no=p.no;
 strcpy(name,p.name);
 sex=p.sex;
 salary=p.salary;
 cout<<"职员对象创建"<<endl;
}
 employee::~employee()
{
 cout<<"职员对象消亡"<<endl;
}
 void employee::display(void)
{
 cout<<"工号："<<no<<endl;
 cout<<"姓名："<<name<<endl;
 cout<<"性别："<<sex<<endl;
 cout<<"薪水："<<salary<<endl;
 b_day.display(); 
}
 void employee::modify(void)
{
 char c;
 cout<<"是否修改工号？请选择Y或者N："<<endl;
 cin>>c;
 if(c=='Y')
 {
  cout<<"请输入新的工号："<<endl;
  int temp;
  cin>>temp;
  no=temp;
 } 
 cout<<"是否修改姓名？请选择Y或者N："<<endl;
 cin>>c;
 if(c=='Y')
 {
  cout<<"请输入新的姓名："<<endl;
  char s[20];
  cin>>s;
  strcpy(name,s);
 } 
 cout<<"是否修改性别？请选择Y或者N："<<endl;
 cin>>c;
 if(c=='Y')
 {
  cout<<"请输入新的性别："<<endl;
  char t;
  cin>>t;
  sex=t;
 } 
 cout<<"是否修改月薪？请选择Y或者N："<<endl;
 cin>>c;
 if(c=='Y')
 {
  cout<<"请输入新的月薪："<<endl;
  int temp;
  cin>>temp;
  salary=temp;
 } 
 cout<<"是否修改出生日期？请选择Y或者N："<<endl;
 cin>>c;
 if(c=='Y')
 {
  cout<<"请输入新的出生日期："<<endl;
  int a1,a2,a3;
  cin>>a1>>a2>>a3;
  b_day.set(a1,a2,a3);
 } 
}
 date::date(int a,int b,int c)
{
 year=a;
 month=b;
 day=c;
 cout<<"日期对象创建"<<endl;
}
 date::date(date &p)
{
 year=p.year;
 month=p.month;
 day=p.day;
 cout<<"日期对象创建"<<endl;
}
 date::~date()
{
 cout<<"日期对象消亡"<<endl;
}
 void date::display(void)
{
 cout<<"年："<<year<<endl;
 cout<<"月："<<month<<endl;
 cout<<"日："<<day<<endl;
}
 void date::set(int a,int b,int c)
{
 year=a;
 month=b;
 day=c;
}
 int main()
{
 employee f(11,"黄连丽",'F',1500,1981,10,23);
 f.display();
 f.modify();
 f.display(); 
 return(0);
}