From 0ed7005b7f933d22c189e3f792156bb99a5e38f5 Mon Sep 17 00:00:00 2001 From: pi5fnqcfr <824659727@qq.com> Date: Tue, 4 Jun 2024 22:01:22 +0800 Subject: [PATCH] ADD file via upload --- Date.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Date.h 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