Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main()
- {
- int tm1,ts1,tm2,ts2,dm1,ds1,dm2,ds2;
- cin>>tm1>>ts1>>tm2>>ts2>>dm1>>ds1>>dm2>>ds2;
- int tufi_sekundi=(tm1*60+ts1)+(tm2*60+ts2);
- int dvojce_sekundi=(dm1*60+ds1)+(dm2*60+ds2);
- int m,s;
- if(tufi_sekundi>dvojce_sekundi){
- cout<<"D"<<endl;
- m=(tufi_sekundi-dvojce_sekundi)/60;
- s=(tufi_sekundi-dvojce_sekundi)%60;
- }
- if(tufi_sekundi<dvojce_sekundi){
- cout<<"T"<<endl;
- m=(dvojce_sekundi-tufi_sekundi)/60;
- s=(dvojce_sekundi-tufi_sekundi)%60;
- }
- cout<<m<<" "<<s<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement