SHARE
TWEET

Untitled

a guest Oct 18th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top