代码拉取完成,页面将自动刷新
#ifndef CPP_TIMING_H
#define CPP_TIMING_H
#include<string>
#include<cstring>
using namespace std;
namespace TIME
{
class Date
{
public:
int year, month, day;
Date(int y, int m, int d): year(y), month(m), day(d)
{}
string toString() const
{
return std::to_string(year)
+ " "
+ std::to_string(month)
+ " "
+ std::to_string(day);
}
};
class Duree
{
public:
int duree;
Duree(int d): duree(d){}
Duree(int _d, int d): duree(d){}
string toString() const
{
return std::to_string(duree);
}
};
class Horaire
{
public:
int hour, minute;
Horaire(int h, int m):hour(h), minute(m){}
string toString() const
{
return std::to_string(hour)
+ " "
+ std::to_string(minute);
}
};
inline std::ostream & operator<<(std::ostream & F, const Date & d) {
string s = std::to_string(d.year)
+ " "
+ std::to_string(d.month)
+ " "
+ std::to_string(d.day);
F << s;
return F;
}
inline std::ostream & operator<<(std::ostream & F, const Duree & d) {
string s = std::to_string(d.duree);
F << s;
return F;
}
inline std::ostream & operator<<(std::ostream & F, const Horaire & h) {
string s = std::to_string(h.hour)
+ " "
+ std::to_string(h.minute);
F << s;
return F;
}
}
#endif //CPP_TIMING_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。