10.6 10.5ĻӶԺء޸ĺĳ£
#include <iostream>
using namespace std;
class Time
{public:
Time( ){minute=0;sec=0;}
Time(int m,int s):minute(m),sec(s){}
Time operator++( );                              //ǰ++غ
Time operator++(int);                           //++غ
void display( ){cout<<minute<<:<<sec<<endl;}
private:
int minute;
int sec;
}; 

Time Timeoperator++( )                     //ǰ++غ
{if(++sec>=60)
{sec-=60;
++minute;}
return *this;                              //ԼӺĵǰ
}

Time Timeoperator++(int)                  //++غ
{Time temp(*this);
sec++;
if(sec>=60)
{sec-=60;
++minute;}
return temp;                                //صԼǰĶ
}

int main( )
{Time time1(34,59),time2;
cout<< time1 : ;
time1.display( );
++time1;
cout<<++time1: ;
time1.display( );
time2=time1++;                             //ԼǰĶֵtime2
cout<<time1++: ;
time1.display( );
cout<< time2 :;
time2.display( );                            //time2ֵ
}