OJ-Problems-Source/QUSTOJ/1862.cpp
2016-10-24 16:35:05 +08:00

31 lines
532 B
C++

#include <iostream>
using namespace std;
class clockx
{
public:
private:
int y,m,d;
int h,min,s;
friend istream& operator >> (istream& is,clockx& c);
friend ostream& operator << (ostream& os,clockx& c);
};
istream& operator >> (istream& is,clockx& c)
{
is>>c.y>>c.m>>c.d>>c.h>>c.min>>c.s;
return is;
}
ostream& operator << (ostream& os,clockx& c)
{
os<<c.y<<" "<<c.m<<" "<<c.d<<endl<<c.h<<":"<<c.min<<":"<<c.s;
return os;
}
int main()
{
clockx s;
cin>>s;
cout<<s<<endl;
return 0;
}