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.

31 lines
788 B

#pragma once
#ifndef DATE_H
#define DATE_H
#include <iostream>
using namespace std;
class Date
{
private:
int year;
int month;
int day;
public:
Date() { year = 0; month = 0; day = 0; }
Date(int y, int m, int d) { year = y; month = m; day = d; }
Date(Date& d) { year = d.year; month = d.month; day = d.day; } //<2F><>ʼ<EFBFBD><CABC>
~Date() { };
void setYear(int y) { year = y; }
void setMonth(int m) { month = m; }
void setDay(int d) { day = d; }
int getYear() { return year; }
int getMonth() { return month; }
int getDay() { return day; }
void inputDate() {
cout << "year<EFBFBD><EFBFBD> "; cin >> year;
cout << "month<EFBFBD><EFBFBD> "; cin >> month;
cout << "day<EFBFBD><EFBFBD> "; cin >> day;
}
void displayDate() { cout << year << "-" << month << "-" << day << endl; }
};
#endif //DATE_H