#ifndef I_DATE_ED
#define I_DATE_ED
#include <iostream>
#include <string>
using namespace std;
// year应当是1800到2200之间的整数;
// month必须是1到12之间的整数;
// day必须是1到给定、月的天数之间的整数;
class Date
{
int year, month, day;
public:
Date() {month = 1; day = 1; year = 1800;}
Date(int, int, int);
bool isvalid(); // 判断Date是否合法
void readinto(); // 用读入的month、day和year设置这个Date的值
Date next(); // 返回Date之后的Date
Date previous(); // 返回Date之前的Date
string dayofweek(); // 返回这个Date是星期几
friend ostream& operator<<(ostream&, Date&);
};
Date::Date(int monthln, int dayln, int yearln)
{
month = monthln;
day = dayln;
year = yearln;
}
bool Date::isvalid()
{
if (year < 1800 || year > 2200)
return false;
else
switch(month){
case 1: case 3: case 5: case 7:
case 8: case 10: case 12:
if (day < 1 || day > 31) return false;
case 4: case 6: case 9: case 11:
if (day &