You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
506 B
26 lines
506 B
#ifndef DATE_H
|
|
#define DATE_H
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
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
|