📄 main.cpp
字号:
#include <iostream>
using namespace std;
class Time;
class Date
{
public:
Date(int y=2005,int m=1,int d=1)
{
year = y;
month= m;
day = d;
}
//* * 1 * *
//* * 2 * *
private:
int year,month,day;
};
class Time
{
public:
Time(int h=0,int m=0,int s=0)
{
hour = h;
minute=m;
second=s;
}
//* * 2 * *
//* * 3 * *
private:
int hour,minute,second;
};
void Date::DateTime(Time& t)
{
//* * 4 * *
}
void DateTime(Date& d,Time& t)
{
cout<<"Now is "<<d.year<<"."<<d.month<<','<<d.day<<' '<<t.hour<<':'<<t.minute
<<':'<<t.second<<endl;
}
void main()
{
Date d;
Time t(10,10,10);
d.DateTime(t);
DateTime(d,t);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -