diff --git a/Date.h b/Date.h new file mode 100644 index 0000000..cc409a5 --- /dev/null +++ b/Date.h @@ -0,0 +1,26 @@ +#ifndef DATE_H +#define DATE_H + +#include +#include + +using namespace std; + +class Date +{ +public: + Date(int year = 0, int month = 0, int day = 0);//构造函数 + string ShowDate();//输出日期 + int getYear() const { return year; }//外部访问接口,获取年 + int getMonth() const { return month; }//外部访问接口,获取月 + int getDay() const { return day; }//外部访问接口,获取天 + +protected: + +private: + int year; + int month; + int day; +}; + +#endif // DATE_H \ No newline at end of file