#include <ctime>
#include <iostream>
#include <string>
#include <sstream>
class timestruct {
protected:
int time_int;
std::string time_str;
public:
timestruct() {
std::time_t rawtime;
std::time(&rawtime);
struct std::tm* ptm=std::localtime(&rawtime);
time_int=ptm->tm_hour*100+ptm->tm_min;
std::ostringstream buff;
buff << ptm->tm_hour << ":" << ptm->tm_min << ":" << ptm->tm_sec;
time_str=buff.str();
}
timestruct& operator= (const timestruct& t);
friend std::ostream& operator << (std::ostream& out,const timestruct& tm) {
return out << tm;
}
operator int() const {
return time_int;
}
operator std::string() {
return time_str;
}
};
int main () {
int n=timestruct();
std::string s=timestruct();
}