// установка временіvoid setTime (int h, int m)
{= (h> = 0 && h <24)? h: 0; = (m> = 0 && m <60)? m: 0;
}
// друк временіstring printTime ()
{(min <10) return hour + ": 0" + min; return hour + ":" + min;
}
// ------ перевантажені оператори -----//
// інкрементstatic Time operator + + (Time t1)
{. min + +; (t1.min> = 60)
{. min - = 60;. hour + +;
} t1;
}
// декрементstatic Time operator - (Time t1)
{. min -; (t1.min <0)
{. min + = 60;. hour -;
} t1;
}
// сложеніеstatic Time operator + (Time t1, Time t2)
{h = t1.hour + t2.hour, m = t1.min + t2.min; (m> = 60)
{- = 60; + +;
} (h> 23)
{- = 24;
} new Time (h, m);
}
// вичітаніеstatic Time operator - (Time t1, Time t2)
{h = t1.hour - t2.hour, m = t1.min - t2.min; (m <0)
{+ = 60; -;
} new Time (h, m);
}
// ділення на ціле чіслоstatic Time operator/(Time t1, int num)
{m, h; = (t1.hour * 60 + t1.min)/num; = m/60; - = h * 60; new Time (h, m);
}
// сравненіеstatic bool operator == (Time t1, Time t2)
{(t1.hour == t2.hour && t1.min == t2.min) return true; return false;
} static bool operator! = (Time t1, Time t2)
{(t1.hour! = t2.hour && t1.min! = t2.min) return true; return false;
} static bool operator> (Time t1, Time t2)
{(t1.hour> t2.hour) return true; if (t1.hour t2.min) return true; if (t1.min
} static bool operator> = (Time t1, Time t2)
{((t1.hour> t2.hour) | | (t1.hour == t2.hour && t1.min> = t2.min)) return true; return false;
} static bool operator <(Time t1, Time t2)
{(t1.hour t2.hour) return false; if (t1.min t2.min) return false; return false;
} static bool operator <= (Time t1, Time t2)
{((t1.hour
}
// ---------------------------------------- ------------