Josif_tepe

Untitled

Apr 22nd, 2026
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int H, M, S, M1, S1;
  8.     cin >> H >> M >> S >> M1 >> S1;
  9.    
  10.     S += S1;
  11.     if(S >= 60) {
  12.         S -= 60;
  13.         M += 1;
  14.     }
  15.    
  16.     M += M1;
  17.     if(M >= 60) {
  18.         M -= 60;
  19.         H += 1;
  20.     }
  21.    
  22.     cout << H << " " << M << " " << S << endl;
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment