#include <iostream>
using namespace std;
class Time {
protected:
int hours, minutes, seconds;
public:
Time(int h, int m, int s) {
hours = h;
minutes = m;
seconds = s;
}
void display() {
cout << "出生时间:" << hours << "时" << minutes << "分" << seconds << "秒" << endl;
}
};
class Date {
protected:
int year, month, day;
public:
Date(int y, int m, int d) {
year = y;
month = m;
day = d;
}
void display() {
cout << "出生年月:" << year << "年" << month << "月" << day << "日" << endl;
}
};
class Birthtime: public Time, public Date {
protected:
string childname;
public:
Birthtime(string cn, int yy, int mm, int dd, int hh, int mint, int ss): Time(hh, mint, ss), Date(yy, mm, dd) {
childname = cn;
}
void display() {
cout << "姓名:" << childname << endl;
Date::display();
Time::display();
}
};
int main() {
Birthtime yx("牛逼", 2022, 11, 30, 20, 22, 22);
yx.display();
return 0;
}