定义一个时间类TIME满足

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

最佳回答

酷酷的乌龟

唠叨的秀发

2026-09-27 12:35:10

#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-09-27 12:35:10

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