Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- int hi,hf,ht,mi,mf,mt;
- void tempo(int hi, int hf, int mi, int mf);
- int main()
- {
- scanf("%d%d%d%d",&hi,&mi,&hf,&mf);
- tempo(hi,hf,mi,mf);
- return 0;
- }
- void tempo(int hi, int hf, int mi, int mf)
- {
- if(hi > hf)
- ht= (24-hi)+hf;
- if(hi < hf)
- ht= hf-hi;
- mt=(60-mi)+mf;
- if(mf+mi >=60)
- {
- ht--;
- }
- if(mt==60)
- {
- ht++;
- mt=0;
- }
- if((hi == hf)&&(mi==mf))
- printf("O JOGO DUROU 24 HORA(S)");
- else
- printf("O jogo durou %d HORA(S) E %d MINUTO(S)",ht,mt);
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement