定义一个时间类TIME满足

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

最佳回答

无限的黑猫

忧伤的哈密瓜,数据线

2026-04-01 10:28:45

#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-04-01 10:28:45

    #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.下列疾病的病原体中,具有真核细胞结构的是( )