한국어< 中文 فارسی English ไทย All Copyright Reserved 2010-2011 SDUSTOJ TEAM GPL2.0 2003-2011HUSTOJ Project TEAM Anything about the Problems, Please Contact Admin:admin
#include <iostream> #include <iomanip> #include <cmath> using namespace std; class Time { private: int s, m, h; public: Time(){ } Time(int hh, int mm, int ss) : s(ss), m(mm), h(hh) { } public: int hour() const{ return h; } int minute() const{ return m; } int second() const{ return s; } public: int hour(int hh) { return h = hh; } int minute(int mm) { return m = mm; } int second(int ss) { return s = ss; } public: Time& inputTime() { cin >> h >> m >> s; return *this; } public: void showTime()const { cout << setw(2) << setfill('0') << h << ":" << setw(2) << setfill('0') << m << ":" << setw(2) << setfill('0') << s << endl; } }; int main() { Time t; int cases; cin>>cases; for(int i = 1; i <= cases; ++i) t.inputTime().showTime(); }