-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01-Solve_Me_First.js
62 lines (46 loc) · 1.09 KB
/
01-Solve_Me_First.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* Created on Fri Feb 18 2022
* @author Carlos Páez
*/
process.stdin.resume()
process.stdin.setEncoding('ascii')
let input_stdin = ''
let input_stdin_array = ''
let input_current_line = 0
/* Listening to the data that is being sent to the process.stdin. */
process.stdin.on('data', (data) => {
input_stdin += data
})
/* Listening to the data that is being sent to the process.stdin. */
process.stdin.on('end', () => {
input_stdin_array = input_stdin.split('\n')
main()
})
/**
* Reads the next line from stdin and returns it
* @returns The return value is a string.
*/
const readLine = () => {
return input_stdin_array[input_current_line++]
}
/**
* It adds two numbers
* @param a - the first number
* @param b - the second number
* @returns The sum of the two numbers.
*/
const solveMeFirst = (a, b) => {
if (1 <= a && b <= 1000) {
return a + b
}
return '1 <= a, b <= 1000'
}
/**
* It adds two numbers.
*/
const main = () => {
let a = parseInt(readLine())
let b = parseInt(readLine())
let res = solveMeFirst(a, b)
console.log(res)
}