慕妹3146593
#include <iostream>using namespace std;class Time{protected:int Hour;int Minute;int second;public:Time();void SetTime(int Hour,int Minute,int second);void ShowTime();};Time::Time(){Hour = 0;Minute = 0;second = 0;}void Time::SetTime(int Hour,int Minute,int second){this->Hour = Hour;this->Minute = Minute;this->second = second;}void Time::ShowTime(){cout<<Hour<<":"<<Minute<<":"<<second<<endl;}int main(){Time T1,T2;T1.SetTime(15,38,42);T2.SetTime(3,4,5);T1.ShowTime();T2.ShowTime();return 0;}