Last active
September 8, 2018 11:20
-
-
Save JeromeBATAILLE/70861fc09cced14343ea22b96e9e15c4 to your computer and use it in GitHub Desktop.
Algorithmique et pseudo-code
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
argentTotal est un nombre réel | |
prixDuBonbon est un nombre réel | |
dépenseBonbons est égal à prixDuBonbon | |
nombreDeBonbons est égal à 0 | |
Début combienDeBonbons (argentTotal, prixDuBonbon) | |
Tant que (dépenseBonbons <= argentTotal ET argenTotal > 0) OU (dépenseBonbons <= argentTotal ET prixDuBonbon > 0) | |
dépenseBonbons <- dépenseBonbons + prixDuBonbon | |
nombreDeBonbons <- nombreDeBonbons + 1 | |
Retourner nombreDeBonbons | |
Fin Tant que | |
Si argenTotal <= 0 OU prixDuBonbon <= 0 | |
Retourner 0 | |
Fin si | |
Fin combienDeBonbons |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment