#include<iostream.h>
class date
{
private:
int day;
int month;
int year;
public:
void getdate(void)
{
cout<<"/nEnter the day(dd):";
cin>>day;
cout<<"/nEnter the month(mm):";
cin>>month;
cout<<"/nEnter the year(yy):";
cin>>year;
} //函数getdate结束
void display(void)
{
cout<<"/nThe date is"<<day<<"/";
cout<<month<<"/"<<year<<endl;
} //函数display结束
};
void main()
{
date today;
today.getdate();
today.display();
}
--《面向对象编程:C++》