#include<iostream>
using namespace std;
enum paople_sex{m,f};
class date
{
private:
int year;
int month;
int day;
public:
date(int year,int month,int day);
void birth()
{
cout<<"the birthday"<<endl;
cout<<"please input the year:";
cin>>year;
cout<<"please input the month:";
cin>>month;
cout<<"please input the day:";
cin>>day;
}
void print2()
{
cout<<year<<"."<<month<<"."<<day<<endl;
}
~date();
};
class people
{
private:
long int number;
char sex;
char id[20];
public:
date b1;
date b2(b1);
people(long int number,char sex,char id[20]);
void xinxi()
{
cout<<"please input the number:";
cin>>number;
cout<<"please input the sex:(m/f)";
cin>>sex;
cout<<"please input the id:";
cin>>id;
b1.birth();
}
void print1()
{
cout<<number<<endl
<<sex<<endl
<<id<<endl;
b2.print2();
}
~people();
};
void main()
{
int i,n;
system("color 9e");
people p1[1000];
people p2[1000](p1[1000]);
cout<<"How many people?";
cin>>n;
for(i=0;i<n;i++)
{
p1[i].xinxi();
}
for(i=0;i<n;i++)
{
p2[i].print1();
}
}
这个程序是输入员工信息,再输出(要求用到构造,析构,内联,拷贝构造,聚集)
貌似问题很严重
请各位帮忙改一下,先谢谢了