Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. process.stdin.resume()
  2. process.stdin.setEncoding('utf8')
  3.  
  4.  
  5. console.log('Please enter you age')
  6.  
  7. process.stdin.on('data', (message) => {
  8. if (typeof message !== 'string'){
  9.  
  10. console.log('A number goddamnit :)!')
  11.  
  12. }
  13.  
  14. else if (message > 99) {
  15.  
  16. console.log('Liar!')
  17.  
  18. }
  19.  
  20. else if (message == 0 ){
  21.  
  22. console.log('Paul you are too young to use a computer!')
  23.  
  24. }
  25.  
  26. else{
  27. let sub = 2019 - message
  28. console.log(sub)
  29. }
  30.  
  31. process.exit()
  32.  
  33. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement