Advertisement
S_h_u_v_r_o

1047

Oct 16th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. int main() //5%wrong answer...uri1047
  3. { //c=final hour,d=final minute
  4. int a,b,c,d,e,f; //a=initial hour,b=initial minute,
  5. scanf("%d%d%d%d",&a,&b,&c,&d);
  6. e=(60*a)+b; //initial time in minute
  7. f=(60*c)+d; //final time in minute
  8. if(e>f){f=60*(c+24)+d;
  9. printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)\n",(f-e)/60,(f-e)%60);}
  10. else if(e<f)printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)\n",(f-e)/60,(f-e)%60);
  11. else if(e==f)printf("O JOGO DUROU 24 HORA(S) E 0 MINUTO(S)\n");
  12. return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement