daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Feb 20th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. #include <stdio.h>
  4.  
  5. int main()
  6.  
  7. {
  8.  
  9.     int st, sm, et, em, rm, rt;
  10.  
  11.     scanf("%d %d %d %d", &st, &sm, &et, &em);
  12.  
  13.     rt = et - st;
  14.  
  15.     if (rt < 0)
  16.  
  17.     {
  18.  
  19.         rt = 24 + (et - st);
  20.  
  21.     }
  22.  
  23.     rm = em - sm;
  24.  
  25.     if (rm < 0)
  26.  
  27.     {
  28.  
  29.         rm = 60 + (em - sm);
  30.  
  31.         rt--;
  32.  
  33.     }
  34.  
  35.     if (et == st && em == sm)
  36.  
  37.     {
  38.  
  39.         printf("O JOGO DUROU 24 HORA(S) E 0 MINUTO(S)\n");
  40.  
  41.     }
  42.  
  43.     else printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)\n", rt, rm);
  44.  
  45.  
  46.  
  47.     return 0;
  48.  
  49. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top