C++ 利用Clock类和Date类定义一个带日期的时钟类ClockWithDate,且对该对象能进行增加秒数的操作
#include <iostream>
using namespace std;
// 日期类:年、月、日
class Date {
private:int year, month, day;
public:Date(int y 2026, int m 1, int d 1) : year(y), month(m), day(d) {}// 日期1(简化:不区分大小月,…
2026/6/24 2:19:17