Advertisement
Guest User

1047

a guest
May 24th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main ()
  5. {
  6. int a, a1, b, b1, x, y, z = 0;
  7. scanf("%d %d %d %d", &a, &a1, &b, &b1);
  8.  
  9. if(b > a) x = b - a;
  10. else if(a == b) x = 24;
  11. else x = (24 - a) + b;
  12.  
  13. if(b1 > a1) y = b1 - a1;
  14. else if(a1 == b1) y = 0;
  15. else {
  16. y = 60 - (a1 - b1);
  17. x--;
  18. }
  19. printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)\n", x, y);
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement