第3题
来源:互联网 发布:淘宝网男士运动裤 编辑:程序博客网 时间:2024/06/07 01:59
#include <iostream>
using namespace std;
class Date
{public:
Date(int=1,int=1,int=2005);
void display();
private:
int month;
int day;
int year;
};
Date::Date(int m,int d,int y):month(m),day(d),year(y)
{ }
void Date::display()
{cout<<month<<"/"<<day<<"/"<<year<<endl;}
int main()
{
Date d1(10,13,2005);
Date d2(12,30);
Date d3(10);
Date d4;
d1.display();
d2.display();
d3.display();
d4.display();
return 0;
}
using namespace std;
class Date
{public:
Date(int=1,int=1,int=2005);
void display();
private:
int month;
int day;
int year;
};
Date::Date(int m,int d,int y):month(m),day(d),year(y)
{ }
void Date::display()
{cout<<month<<"/"<<day<<"/"<<year<<endl;}
int main()
{
Date d1(10,13,2005);
Date d2(12,30);
Date d3(10);
Date d4;
d1.display();
d2.display();
d3.display();
d4.display();
return 0;
}
0 0
- 第3章 第3题
- 第2章第3题
- 第2章 第3题
- 第3章 第4题
- 第3章 第5题
- 第3章 第7题
- 第3章 第8题
- 第3章 第9题
- 第3章 第10题
- 第3章 第11题
- 第3章 第12题
- 第4章 第3题
- 第5章 第3题
- 第5章第3题
- 第3章第37题
- 第7章第3题
- 第7章 第3题
- 第10章第3题
- 转载]ThinkPHP的多表查询
- VC++如何处理自定义消息
- 4.21
- 使用texlive写硕士论文
- IDT 中断描述符表
- 第3题
- (转)【Unity技巧】Unity中的优化技术
- nyoj-1052 看美女(二)
- 在Android中进程按优先级
- CURD方法盘点:table方法
- linux下安装beego(linux(centos/ubuntu) install beego)
- HDOJ 1873 看病要排队
- Ubuntu安装配置Mysql
- Ibator1.2版本的bug /by zero Nullpoint