#include<iostream>
using namespace std;
class Date
{
public:
void printDate()
{
cout<<year<<""<<month<<""<<day<<endl;
}
void GetYear()
{
cout<<year<<endl;
}
void GetMonth()
{
cout<<month<<endl;
}
void GetDay()
{
cout<<day<<endl;
}
void SetDate(double y,double m,double d)
{
y=year;
m=month;
d=day;
}
private:
double year;
double month;
double day;
};
int main()
{
Date d1;
Date d2;
Date d3(d1);
d1.SetDate(2010,6,8);
d2.SetDate(2009,4,4);
d1.GetYear();
d2.GetMonth();
d3.GetDay();
system("PAUSE");
return 0;
}
using namespace std;
class Date
{
public:
void printDate()
{
cout<<year<<""<<month<<""<<day<<endl;
}
void GetYear()
{
cout<<year<<endl;
}
void GetMonth()
{
cout<<month<<endl;
}
void GetDay()
{
cout<<day<<endl;
}
void SetDate(double y,double m,double d)
{
y=year;
m=month;
d=day;
}
private:
double year;
double month;
double day;
};
int main()
{
Date d1;
Date d2;
Date d3(d1);
d1.SetDate(2010,6,8);
d2.SetDate(2009,4,4);
d1.GetYear();
d2.GetMonth();
d3.GetDay();
system("PAUSE");
return 0;
}