高手请教
用运算符重载实现:显示中华人民共和国建国100年的465天后的日期
谁可以帮我把这个题目做出来啊
[解决办法]
CDate cur;
cur+=(long)100; //增加100年
cur+=(int)0; //增加0个月
cur+=(short)465;//增加465天
class CDate
{
public:
CDate(){获取并转换当前日期为天数}
CDate& operator+=(long year){ days+=365*year; return *this;}
CDate& operator+=(int month){ days+=30*year; return *this;}
CDate& operator+=(short day){ days+=day; return *this;}
private:
long days; //年月日换算成天数存储可便于计算日期间的天数差值
};