没注释的源代码
#include <iostream>
using namespace std;
class Date
{
private:
int month;
int day;
int year;
public:
void display()
{
cout<<month<<"/"<<day<<"/"<<year<<endl;
}
Date(int,int,int);
Date(int,int);
Date(int);
Date();
};
Date::Date(int m,int d,int y)
{
month=m;
day=d;
year=y;
}
Date::Date(int m,int d)
{
month=m;
day=d;
year=2005;
}
Date::Date(int m)
{
month=m;
day=18;
year=2005;
}
Date::Date()
{
month=10;
day=18;
year=2005;
}
int main()
{
Date d1(5,6,2013);
Date d2(5,6);
Date d3(5);
Date d4;
d1.display();
d2.display();
d3.display();
d4.display();
return 0;
}