展开全部
字节调试下,设置日期
public class Date()
{
friend public const Date operate+(const Date & _date,int ndays)
{
return Date(_date.m_day+ndays,_date.m_mouth,_date.m_year);
}
public:
Date():m_day(0),m_mouth(0),m_minute(0){};
Date(int _day,int _mouth,int _year):m_day(_day),m_mouth(_mouth),m_year(_year){};
void setDate(int _day,int _mouth,int _year)
{
m_day=_day;
m_mouth =_mouth;
m_year =_year;
}
~Data(){};
ostream &operate<<(ostream &,const Date& _date)
{
cout<<_date.m_day<<"日"<<_date.m_mouth<<"月“<<"_date.m_year"<<"年"<<endl;
}
privata:
int m_day;
int m_mouth;
int m_minute;
}
public class Date()
{
friend public const Date operate+(const Date & _date,int ndays)
{
return Date(_date.m_day+ndays,_date.m_mouth,_date.m_year);
}
public:
Date():m_day(0),m_mouth(0),m_minute(0){};
Date(int _day,int _mouth,int _year):m_day(_day),m_mouth(_mouth),m_year(_year){};
void setDate(int _day,int _mouth,int _year)
{
m_day=_day;
m_mouth =_mouth;
m_year =_year;
}
~Data(){};
ostream &operate<<(ostream &,const Date& _date)
{
cout<<_date.m_day<<"日"<<_date.m_mouth<<"月“<<"_date.m_year"<<"年"<<endl;
}
privata:
int m_day;
int m_mouth;
int m_minute;
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询