aboutsummaryrefslogtreecommitdiff
path: root/challenge-117/abigail/node/ch-1.js
blob: eee9ce7ee1c2a31fe61ce374830696cf21b26840 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/local/bin/node

//
// See ../README.md
//

//
// Run as: node ch-1.js < input-file
//

let SUM_15 = 120
let sum = 0

  require ('readline')
. createInterface ({input: process . stdin})   
. on              ('line', line => {
    let [num] = line . split (/,/)
    sum +=+ num
})
. on              ('close', () => console . log (SUM_15 - sum))