#include class Time { int hours; int minutes; int seconds; public: explicit Time(int hh = 0, int mm = 0, int ss = 0) : hours(hh), minutes(mm), seconds(ss) { } Time operator+(Time other) { hours += other.hours; minutes += other.minutes; seconds += other.seconds; return *this; } friend inline std::ostream& operator<<(std::ostream& out, const Time& time) { return out << time.hours << ':' << time.minutes << ':' << time.seconds; } }; int main() { Time actual(13, 30); Time periodo(8); Time pildora1 = actual + periodo; Time pildora2 = pildora1 + periodo; std::cout << "Son las " << actual << std::endl; std::cout << "Proxima pildora a las " << pildora1 << std::endl; std::cout << "Y la siguiente a las " << pildora2 << std::endl; }