Advertisement
Guest User

Untitled

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