26 lines
449 B
Python
26 lines
449 B
Python
x = 1170
|
|
y = 290
|
|
h = 324*100
|
|
|
|
jour = 0
|
|
alt = 0
|
|
histo = [0, 0]
|
|
while True:
|
|
#Jour, il monte de x
|
|
alt += x
|
|
x -= 2
|
|
print("Fin du jour {} : altitude= {} cm".format(jour, alt))
|
|
if alt > h:
|
|
break
|
|
#nuit, il glisse de y
|
|
alt -= y
|
|
|
|
#pleut-il?
|
|
if (jour+1)%5 == 0:
|
|
alt = histo[1]
|
|
print("Fin de la nuit {} : altitude={} cm".format(jour, alt))
|
|
|
|
jour += 1
|
|
histo = [alt, histo[0]]
|
|
|
|
print(jour) |