Загрузка данных


#include <iostream>
using namespace std;
struct MyTime {
public:
    int sec; int min; int hour;
    MyTime(int h, int m, int s):
        hour(h), min(m), sec(s){}
    void IncSec()    {
        if (++sec == 60) { sec = 0; min++; }
        if (min == 60)   { min = 0; hour++; }
        if (hour == 24) { hour = 0; }
    }
};
ostream& operator<< (ostream& strm, const MyTime& mt)
{
    return strm << (mt.hour < 10 ? "0" : "") << mt.hour << ":" <<
        (mt.min < 10 ? "0" : "") << mt.min << ":" <<
        (mt.sec < 10 ? "0" : "") << mt.sec << endl;
}
int main()
{ //7:00:15, lunch 15:30:30 //supper 19:59
    MyTime mtBrkFst(7,0,15);
    MyTime mtLunch(15, 30, 30);
    MyTime mtDinner(19, 59, 0);
   
    mtBrkFst.IncSec();
    cout << mtBrkFst << endl;

    cout << mtLunch  << endl;

    cout << mtDinner << endl;

}