//designed by yyw // #include #include //setfill() 填充 //setw() 宽 //setprecision()显示数字位数 using namespace std; class calendar { public: void Menu_present() { cout<<"This is a calendar"<> menu_number; if (!cin.fail())break; if (cin.fail()) { cin.clear(); cin.sync(); cout << "Your input is illegal" << endl; cout << "please input the number correctly" << endl; cout << "other char is not allowed" << endl; continue; } } switch(menu_number) { case 1: M_Search(); break; case 2: Check(); break; // case 3: // break; case 88: cout<<"Good bye,have a good day!"<> year; // if(year<0){ // //cin.clear(); // cin.sync(); // cout<<"year wrong"<> month; if(!cin.fail()){ if(month<1||month>12){ cin.clear(); cin.sync(); cout<<"month wrong"<> day; // if(day<1||day> month_judge(year,month)){cin.clear();cin.sync();cout<<"day wrong"< month_judge(year,month)){cin.clear();cin.sync();cout<<"day wrong"<4&&day<15))cout<<"This is none day"<> year; if(!cin.fail()){ if(year<0){ cin.clear(); cin.sync(); cout<<"year wrong"<> c; if(!cin.fail())break; if (cin.fail()) { cin.clear(); cin.sync(); cout << "Your input is illegal" << endl; cout << "please input the number correctly" << endl; cout << "other char is not allowed" << endl; continue; } }//cin 选择 switch(c) { case 1: send1_12(year); break; case 2: send2_6(year); break; default: cout<<"Invalid input"<1582||((year==1582&&month>10)||(year==1582&&month==10&&day>4)))//geli { f=(day+2*month+3*(month+1)/5+year+year/4-year/100+year/400+1)%7; if(f==0)f=7; return f; }else//ruli { f=(day+2*month+3*(month+1)/5+year+year/4-year/100+year/400+4)%7; if(f==0)f=7; return f; } }// 返回星期几 void send1_12(int year){ for(int i=1;i<=12;i++)// 12个月 { cout<