Created
March 19, 2018 15:20
-
-
Save florentinH/3ed274a1f8181e4d5967e70231c518e6 to your computer and use it in GitHub Desktop.
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
process.stdin.resume() | |
process.stdin.setEncoding('utf8') | |
console.log('Quel âge as tu ? ') | |
process.stdin.on('data', (number) => { | |
resultat = 2018 - (number) | |
if (number <= 99 && number > 0) { | |
console.log('Ton année de naissance est: ' + resultat) | |
} | |
else if (isNaN(number)) { | |
console.log('Il me faut ton âge !!!') | |
} | |
else { | |
console.log('Il y a une erreur dans la matrice pour ' + number); | |
} | |
process.exit() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment