Advertisement
Josif_tepe

Untitled

Dec 16th, 2023
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int tm1, ts1, tm2, ts2;
  6.     cin >> tm1 >> ts1 >> tm2 >> ts2;
  7.    
  8.     int dm1, ds1, dm2, ds2;
  9.     cin >> dm1 >> ds1 >> dm2 >> ds2;
  10.    
  11.     int vkupno_tufi = tm1 * 60 + ts1 + tm2 * 60 + ts2;
  12.     int vkupno_dvojce = dm1 * 60 + ds1 + dm2 * 60 + ds2;
  13.    
  14.     if(vkupno_tufi < vkupno_dvojce) {
  15.         cout << "T" << endl;
  16.     }
  17.     else {
  18.         cout << "D" << endl;
  19.     }
  20.     int raz = abs(vkupno_tufi - vkupno_dvojce);
  21.    
  22.     cout << (raz / 60) << " " << (raz % 60) << endl;
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement