Skip to content

Instantly share code, notes, and snippets.

@PradalCyril
Created October 18, 2018 14:40
Show Gist options
  • Save PradalCyril/f1e07a4eb71fb24bf5bca5b482752110 to your computer and use it in GitHub Desktop.
Save PradalCyril/f1e07a4eb71fb24bf5bca5b482752110 to your computer and use it in GitHub Desktop.
process.stdin.resume()
process.stdin.setEncoding('utf8')
let i=0;
console.log('How old are you ? ')
process.stdin.on('data', (number) => {
i=parseInt(number);
if(i>=18 && i<=99){
i= 2018 -i;
console.log('tu es né(e) en ' + i)
}else if(i==0){
console.log("Un bébé devant un écran ? sérieusement ?")
}else{
console.log("Erreur")
}
process.exit()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment