useclock.cpp

来自「C++&datastructure书籍源码,以前外教提供现在与大家共享」· C++ 代码 · 共 24 行

CPP
24
字号
#include <iostream>using namespace std;#include "clockt.h"// test program for ClockTime classint main(){    int h,m,s;    cout << "enter two sets of 'h m s' data " << endl         << "Enter non integers to terminate program." << endl << endl;    while (cin >> h >> m >> s)    {   ClockTime a(s,m,h);        cin >> h >> m >> s;        ClockTime b(s,m,h);        ClockTime c = a + b;                cout << a << " + " << b << " = " << c << endl;    }    return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?