fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int A,B,C,D, th, tm;
  5.  
  6. scanf("%d%d%d%d", &A, &B, &C,&D);
  7.  
  8. if(A < C){
  9.  
  10. if (B < D){
  11. th = C - A;
  12. tm = (D - B);
  13. }
  14. if (B > D){
  15. th = C - A - 1;
  16. tm = (B - D) - 60;
  17. tm *= -1;
  18. }
  19. if (B == D){
  20. th = C - A;
  21. tm = (D - B);
  22. }
  23. }
  24. if(A == C){
  25.  
  26. if(B == D){
  27. th = 24;
  28. tm = 0;
  29. }
  30. if(B < D){
  31.  
  32. th = A - C;
  33. tm = D - B;
  34.  
  35. }
  36. }
  37.  
  38. printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)\n", th, tm);
  39.  
  40. return 0;
  41. }
Success #stdin #stdout 0s 9416KB
stdin
22 9 9 59
stdout
O JOGO DUROU 0 HORA(S) E 848021456 MINUTO(S)