Advertisement
Josif_tepe

Untitled

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