Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int h, m, s;
- cin >> h >> m >> s;
- int m1, s1;
- cin >> m1 >> s1;
- s += s1;
- if(s >= 60) {
- s -= 60;
- m += 1;
- }
- m += m1;
- if(m >= 60) {
- m -= 60;
- h += 1;
- }
- cout << h << " " << m << " " << s << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement