-
Notifications
You must be signed in to change notification settings - Fork 0
/
1047.py
45 lines (32 loc) · 852 Bytes
/
1047.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
hi,mi,hf,mf=map(int, input().split())
if (hf-hi==1) and (mi>mf):
a=60-mi
m= a+mf
h=0
print("O JOGO DUROU %d HORA(S) E %d MINUTO(S)" %(h,m))
elif (hi==hf)and (mi==mf):
h=24
m=0
print("O JOGO DUROU %d HORA(S) E %d MINUTO(S)" %(h,m))
elif (hi<hf) and (mi<mf):
h= hf-hi
m=mf-mi
print("O JOGO DUROU %d HORA(S) E %d MINUTO(S)" %(h,m))
elif (hi<hf)and(mi>mf):
h= (hf-hi)-1
a= 60-mi
m=a+mf
print("O JOGO DUROU %d HORA(S) E %d MINUTO(S)" %(h,m))
elif (hi==hf)and(mi<mf):
h=0
m=mf-mi
print("O JOGO DUROU %d HORA(S) E %d MINUTO(S)" %(h,m))
elif (hi>hf):
h=(24-hi)+hf
m=mf-mi
if (mi>mf):
h=h-1
m=(60-mi)+mf
print("O JOGO DUROU %d HORA(S) E %d MINUTO(S)" %(h,m))
else:
print("O JOGO DUROU %d HORA(S) E %d MINUTO(S)" %(h,m))