#include<iostream.h>
class Date{
int y,m,d;
public:
Date(){
y=2015;m=4;d=30;
}
Date(int y,int m,int d){
this->y=y;
this->m=m;
this->d=d;
}
Date operator ++(){
++d;
cout<<d;
return *this;
}
Date operator ++(int){
d++;
cout<<d;
return *this;
}
void display(){
cout<<y<<m<<d;
}
};
void main(){
Date d1(2015,5,2);
d1++;
cout<<"\n";
++d1;
}
复制粘贴~