Advertisement
Josif_tepe

Untitled

Sep 26th, 2021
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 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.         m=(tufi_sekundi-dvojce_sekundi)/60;
  14.         s=(tufi_sekundi-dvojce_sekundi)%60;
  15.     }
  16.     if(tufi_sekundi<dvojce_sekundi){
  17.         cout<<"T"<<endl;
  18.         m=(dvojce_sekundi-tufi_sekundi)/60;
  19.         s=(dvojce_sekundi-tufi_sekundi)%60;
  20.  
  21.     }
  22.     cout<<m<<" "<<s<<endl;
  23.  
  24.  return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement