Create 1862.cpp

pull/45/head
Kirigaya Kazuto 2016-10-24 16:35:05 +08:00 committed by GitHub
parent bf120b3cdd
commit 002b8598ba
1 changed files with 30 additions and 0 deletions

30
QUSTOJ/1862.cpp Normal file
View File

@ -0,0 +1,30 @@
#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;
}