Advertisement
Guest User

shimon

a guest
Feb 23rd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int a,b,c,d;
  5. int p,q,r,s=0;
  6. scanf("%d%d%d%d",&a,&b,&c,&d);
  7. p=a*60+b;
  8. r=c*60+d;
  9.  
  10. if(a<=c)
  11. {
  12. s=r-p;
  13. if(s==0)
  14. printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)\n",24,s%60);
  15. else
  16. printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)\n",(s-s%60)/60,s%60);
  17. }
  18. else
  19. {
  20. s=(24*60-p)+r;
  21. printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)\n",(s-s%60)/60,s%60);
  22. }
  23.  
  24. return 0;
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement