Advertisement
Josif_tepe

Untitled

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