#include #include"clock.h" using namespace std; Clock::Clock(int NewH,int NewM,int NewS) { this->Hour=NewH; this->Minute=NewM; this->Second=NewS; } Clock::Clock(Clock &c) { this->Hour=c.Hour; this->Minute=c.Minute; this->Second=c.Second; } void Clock::SetTime(int NewH,int NewM,int NewS) { //加不加this指针都一样 this->Hour=NewH; this->Minute=NewM; this->Second=NewS; } void Clock::ShowTime() { cout<Hour<Minute<Second<