Created
October 18, 2018 14:40
-
-
Save PradalCyril/f1e07a4eb71fb24bf5bca5b482752110 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') | |
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