第三章
2015-07-03 16:25
344 查看
class Date{ private: int year; int month; int day; public: Date(int y=0,int m=0,int d=0):year(y),month(m),day(d){} Date(const Date&D):year(D.year),month(D.month),day(D.day){} int Getyear(){return year;} int Getmonth(){return month;} int Getday(){return day;} void Dashow(); Date DaInput(); ~Date(){} }; Date Date::DaInput(){ int y,m,d; cout<<" ****************年:"; cin>>y; cout<<" ****************月:"; cin>>m; cout<<" ****************日:"; cin>>d; return Date(y,m,d); } void Date::Dashow(){ cout<<year<<" "<<"年"<<" "<<month<<" "<<"月"<<" "<<day<<" "<<"日"<<endl; }
相关文章推荐
- GRE写作必备句型
- 八大排序算法
- Unity3d代码从Android/IOS迁移到WindowsPhone经验笔记
- java学习08--程序控制流程--判断结构if练习
- AlarmManager定时器
- C++ Primer学习笔记(4)——指针和引用的比较
- juniper SRX PPPOE配置
- 安卓笔记
- 浅谈C++多态性
- PeopleCode
- table里td标签的width属性在ie浏览器中无效解决方法
- 本周回顾
- http请求的组成部分
- [转载] tmux 使用指南
- 字体
- 关于Linq to sql更新的问题
- FTP上传图片以及下载图片
- CWnd::MoveWindow
- Google排名优化圣经
- 黑马程序员学习日记 Java中的垃圾回收机制