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. if (B < D){
  10. th = (24 - a) + C;
  11. tm = (D - B);
  12. }
  13. if (B > D){
  14. th = (24 - A) + C;
  15. tm = (B - D) - 60;
  16. tm *= -1;
  17. }
  18. if (B == D){
  19. th = (24 - A) + C;
  20. tm = (D - B);
  21. }
  22. }
  23.  
  24.  
  25. if(A < C){
  26.  
  27. if (B < D){
  28. th = C - A;
  29. tm = (D - B);
  30. }
  31. if (B > D){
  32. th = C - A - 1;
  33. tm = (B - D) - 60;
  34. tm *= -1;
  35. }
  36. if (B == D){
  37. th = C - A;
  38. tm = (D - B);
  39. }
  40. }
  41. if(A == C){
  42.  
  43. if(B == D){
  44. th = 24;
  45. tm = 0;
  46. }
  47. if(B < D){
  48.  
  49. th = A - C;
  50. tm = D - B;
  51.  
  52. }
  53. }
  54.  
  55. printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)\n", th, tm);
  56.  
  57. return 0;
  58. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
22 10 9 22
compilation info
prog.c: In function ‘main’:
prog.c:10:19: error: ‘a’ undeclared (first use in this function)
        th = (24 - a) + C;
                   ^
prog.c:10:19: note: each undeclared identifier is reported only once for each function it appears in
stdout
Standard output is empty