Advertisement
Josif_tepe

Untitled

Feb 23rd, 2024
720
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int h, m, s;
  6.     cin >> h >> m >> s;
  7.    
  8.     int m1, s1;
  9.     cin >> m1 >> s1;
  10.    
  11.     s += s1;
  12.     if(s >= 60) {
  13.         s -= 60;
  14.         m += 1;
  15.     }
  16.     m += m1;
  17.     if(m >= 60) {
  18.         m -= 60;
  19.         h += 1;
  20.     }
  21.     cout << h << " " << m << " " << s << endl;
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement