mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1862.cpp
This commit is contained in:
parent
bf120b3cdd
commit
002b8598ba
30
QUSTOJ/1862.cpp
Normal file
30
QUSTOJ/1862.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user