#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define mem(a, b) memset((a), (b), sizeof(a))
#define inf 0x3f3f3f3f
#define infl 0x3f3f3f3f3f3f3f3f
// #define ll long long
#define seed 13331
#define MOD 1000000007
#define ls u << 1
#define rs u << 1 | 1
class CDate
{
public:
int y,m,d;
CDate(int y, int m,int d) : y(y),m(m),d(d) {}
void Print()
{
printf("%d-%d-%d",y,m,d);
}
};
class CPerson
{
public:
string s1,s2;
int n1;
CPerson(string s1, int n1,string s2) : s1(s1),s2(s2),n1(n1) {}
void get()
{
cout<<s1<<" "<<n1<<" "<<s2;
}
void Print()
{
get();
cout<<"\n";
}
};
class CStudent : virtual public CPerson
{
public:
string s1;
CDate d;
int n1;
CStudent(string _s1, int _n1,string _s2,string s1, int n1, CDate d) : CPerson(_s1,_n1,_s2),s1(s1),d(d),n1(n1) {}
void get()
{
cout<<s1<<" ";
d.Print();
cout<<" "<<n1;
}
void Print()
{
CPerson::get();
cout<<" ";
get();
cout<<"\n";
}
};
class CTeacher : virtual public CPerson
{
public:
string _s1, _s2;
CDate d;
CTeacher(string s1, int n1,string s2, string _s1, string _s2, CDate d) : CPerson(s1,n1,s2),_s1(_s1),_s2(_s2),d(d) {}
void get()
{
cout<<_s1<<" "<<_s2;
cout<<" ";
d.Print();
}
void Print()
{
CPerson::get();
cout<<" ";
get();
cout<<"\n";
}
};
class CGraduate : virtual public CStudent
{
public:
string __s1, __s2;
CGraduate(string _s1, int _n1,string _s2,string s1, int n1, CDate d, string __s1, string __s2) : CStudent(_s1,_n1,_s2,s1,n1,d), CPerson(_s1,_n1,_s2), __s1(__s1),__s2(__s2) {}
void get()
{
CStudent::get();
cout<<" ";
cout<<__s1<<" "<<__s2;
}
void Print()
{
CPerson::get();
cout<<" ";
get();
cout<<"\n";
}
};
class CGradOnWork : public CGraduate, public CTeacher
{
public:
CGradOnWork(string s1, int n1, string s2, string s3, string s4, CDate d1, string s5, CDate d2, int n2, string s6, string s7) :
CPerson(s1,n1,s2),
CStudent(s1,n1,s2,s5,n2,d2),
CTeacher(s1,n2,s2,s3,s4,d1),
CGraduate(s1,n1,s2,s5,n2,d2,s6,s7) {}
void Print()
{
CPerson::get();
cout<<" ";
CTeacher::get();
cout<<" ";
CGraduate::get();
cout<<"\n";
}
};
标签:typedef,ll,memset,long,111,define
From: https://www.cnblogs.com/holycrap/p/18124287