#include<iostream.h> class CDate{ private: int a,b,c,flag; public: void out(void) { cout<<"please input year,month,day by order"<<endl; } void output() { cout<<"after plus the date what you input ,the final is"<<a<<"year"<<b<<"month"<<c+1<<"day"<<endl; } void center() { CDate CDate1; cin>>a>>b>>c; switch(b) { case 1: case 3: case 5: case 7: case 8: case 10: if(c>=31) { c=c%31; b=b+1; } else c=c; case 12: if(c>=31) { c=c%31; b=1; a=a+1; } else c=c;break; case 4: case 6: case 9: case 11: if(c>30) c=(c%30);break; case 2: if(!(a%400)) flag=1; else if(!(a%4)&&a%100) flag=1; else flag=0; if(flag) { if(c>=29) { c=c%29; } else { c=c; } } else { if(c>=28) {c=c%28; b=b+1; } else c=c; } } } }; void main() { CDate CDate1; CDate1.out(); CDate1.center(); CDate1.output(); }