设计一个时间类Time,要求: 1、包含时(hour),分(minute),秒(second)私有数据成员; 2、包含构造函数,重
设计一个时间类Time,要求: 1、包含时(hour),分(minute),秒(second)私有数据成员; 2、包含构造函数,重
日期:2012-04-18 10:49:26 人气:2
#include
using namespace std;
class Time
{
public:
Time();
Time(int h, int m ,int s);
Time operator +(Time &t1);
Time operator >>(Time &t1);
Time operator <<(Time &t1);
void setHour(int h )
{
hour=h;
}
void setMin