Created
November 5, 2020 06:11
-
-
Save Djaxis/abb744a1864660fa26837db528f2d984 to your computer and use it in GitHub Desktop.
France IOI - Calcul des dénivelées
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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