Skip to content

Instantly share code, notes, and snippets.

@florentinH
Created March 19, 2018 15:20
Show Gist options
  • Save florentinH/3ed274a1f8181e4d5967e70231c518e6 to your computer and use it in GitHub Desktop.
Save florentinH/3ed274a1f8181e4d5967e70231c518e6 to your computer and use it in GitHub Desktop.
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