//Ex6_12.cpp
#include "iostream" 
using namespace std;
class Time;
class Date
{private:
   int day,month,year;
 public:
   Date(int y=2008,int m=1,int d=1)
	{year=y;month=m;day=d;}
   void DateTime(Time &t);   //Date类的成员函数DateTime
};
class Time
{private:
    friend Date;   //声明Date为它的友元类
    int hour,minute,second;
 public:
	Time(int h=0,int m=0,int s=0)
	 {hour=h;minute=m;second=s;}
};
void Date::DateTime(Time &t)
{cout<<"Now is:"<<year<<"-"<<month<<"-"<<day<<"  ";
 cout<<t.hour<<":"<<t.minute<<":"<<t.second<<endl;}
void main()
{Date d(2008,8,8);
 Time t(8,8,8);     
 d.DateTime(t);  
}
