Guest User

Untitled

a guest
Apr 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int rez,a1,a2,b1,b2,c1,c2;
  4. char k;
  5. int main()
  6. {
  7. cin >>a1>>k>>b1>>k>>c1;
  8. cin >>a2>>k>>b2>>k>>c2;
  9. b1+=a1*60;
  10. c1+=b1*60;
  11. b2+=a2*60;
  12. c2+=b2*60;
  13. rez=c2-c1;
  14. if (rez==0) {rez=24*60*60;}
  15. if (rez<0) {rez+=24*60*60;}
  16. b1=rez/60;
  17. c1=rez%60;
  18. a1=b1/60;
  19. b1=b1%60;
  20. if (a1<10) {cout<<0;}
  21. cout <<a1<<":";
  22. if (b1<10) {cout<<0;}
  23. cout <<b1<<":";
  24. if (c1<10) {cout<<0;}
  25. cout <<c1;
  26. }
Add Comment
Please, Sign In to add comment