第五章作业5.17
来源:互联网 发布:星光大道网络赛区 编辑:程序博客网 时间:2024/06/15 23:14
#include<iostream>#include<string>using namespace std;class Time{public:Time(int h,int m,int s){hours=h;minutes=m;seconds=s;}void display(){cout<<"出生日期:"<<hours<<"时"<<minutes<<"分"<<seconds<<"秒"<<endl;}protected:int hours,minutes,seconds;};class Date{public:Date(int y,int m2,int d){month=m2;day=d;year=y;}void display(){cout<<"出生年月:"<<year<<"年"<<month<<"月"<<day<<"日"<<endl;}protected:int month,day,year;};class Birthtime:public Time,public Date{public:Birthtime(int h,int m1,int s,int y,int m2,int d,string c):Time(h,m1,s),Date(y,m2,d){Childname=c;}void display(){cout<<"姓名为:"<<Childname<<"的小孩"<<endl;Time::display();Date::display();}private:string Childname;};int main(){Birthtime B1(12,32,23,2010,5,9,"ddd");B1.display();return 0;}
0 0
- 第五章作业5.17
- 第五章:作业
- 第五章:作业
- 第五章作业。
- 第五章实验作业
- 第五章作业
- 第五章作业
- 第五章作业
- 第五章作业
- 第五章作业part1
- 第五章作业
- 第五章作业
- 第五章作业
- 第五章作业
- 第五章作业二
- 第五章作业一
- 第五章作业
- 第五章作业
- UI设计:英文字体运用指导手册
- 【前端工程师之路】JavaScript——windows对象
- MySQL在Linux Ubuntu中安装
- hdu 2425 Hiking Trip
- 在EasyUI的DataGrid中嵌入Combobox
- 第五章作业5.17
- Longest Common Prefix
- poj 1936 All in All
- hadoop yarn resouce manager如何避免单点问题
- codeforces Round #310(Div.1) 题解
- 线程同步--悲观锁
- Codeforces Round #310 (Div. 2)
- getch()和getchar()的区别
- 北大ACM试题1011-DFS