Skip to content

Instantly share code, notes, and snippets.

@Djaxis
Created November 5, 2020 06:11
Show Gist options
  • Save Djaxis/abb744a1864660fa26837db528f2d984 to your computer and use it in GitHub Desktop.
Save Djaxis/abb744a1864660fa26837db528f2d984 to your computer and use it in GitHub Desktop.
France IOI - Calcul des dénivelées
nbCotes=int(input()) # le nombre de montées et descentes
totalPos=0
totalNeg=0
for loop in range(nbCotes) :
denivelé=int(input()) #la variation d'altitude entier étant strictement positif
if denivelé > 0 :
totalPos+=denivelé # le totale positif = ajoute dénivelé positif
totalNeg+=denivelé # le totale négatif = ajoute dénivelé négatif
print(totalPos)
print(-totalNeg) #strictement négatif dans le cas d'une descente
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment