Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <iomanip>
- #include <cmath>
- #include <string>
- using namespace std;
- class time
- {
- private:
- long long Hou, Min, Sec;
- long long Allsec;
- public:
- time( ){ Hou = 0, Min = 0, Sec = 0, Allsec = 0; }
- void getData()
- {
- cin >> Hou >> Min >> Sec;
- }
- int getAllsec()
- {
- Allsec = Hou*3600+Min*60+Sec;
- return Allsec;
- }
- ~time(){};
- };
- int main()
- {
- time t;
- int H, M, S, temp;
- int NumN;
- cin >> NumN;
- t.getData();
- temp = t.getAllsec();
- for( int i=0; i<NumN; i++ )
- {
- temp = temp / 3;
- H = temp/3600;
- M = (temp%3600)/60;
- S = (temp%3600)%60;
- cout << setfill('0') << setw(2) << H << ":";
- cout << setfill('0') << setw(2) << M << ":";
- cout << setfill('0') << setw(2) << S << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement