定义一个时间类TIME满足

学习 时间:2026-05-30 21:26:56 阅读:7469
定义一个时间类TIME满足1.能设置时间;2.能以后"--:--:--"格式输出时分秒;3.能对某一时间进行增加一秒的操作;4,能对某一时间进行减少一秒的操作.追加给分

最佳回答

迅速的摩托

成就的小笼包

2026-05-30 21:26:56

#include using namespace std;class Time{public:Time() :seconds(0) {}void set(unsigned long _seconds) { seconds = _seconds; }void inc(void) { seconds++; }void dec(void) { seconds--; }void print(void){unsigned long temp = seconds;cout

最新回答共有2条回答

  • 含蓄的冬瓜
    回复
    2026-05-30 21:26:56

    #include using namespace std;class Time{public:Time() :seconds(0) {}void set(unsigned long _seconds) { seconds = _seconds; }void inc(void) { seconds++; }void dec(void) { seconds--; }void print(void){unsigned long temp = seconds;cout

上一篇 提示词:teacher, teach the students, help the students, give the

下一篇 1.下列疾病的病原体中,具有真核细胞结构的是( )