求C++程序设计:给出一个日期类的定义。其中包含month,day和year三个属性,以及显示日期的函数。
求C++程序设计:给出一个日期类的定义。其中包含month,day和year三个属性,以及显示日期的函数。
日期:2020-12-15 06:48:57 人气:2
个人认为应该加入日期检测功能
#include using namespace std;class datestruct{public: void ShowDate(void); void SetDate(void);private: int year; int month; int date; static int days1[]; static int days2[];};int datestruct::days1[]={31,28,31,30,31,30,31,31,30,31,30,31};