Complete the function solveMeFirst to compute the sum of two integers. In javascript
Complete the function solveMeFirst to compute the sum of two integers. In javascript
Example
Return .
Function Description
Complete the solveMeFirst function in the editor below.
solveMeFirst has the following parameters:
- int a: the first value
- int b: the second value
Returns
- int: the sum of a and b
Constraints
1<a; b<1000;
process.stdin.resume();
process.stdin.setEncoding('ascii');
var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;
process.stdin.on('data', function (data) {
input_stdin += data;
});
process.stdin.on('end', function () {
input_stdin_array = input_stdin.split("\n");
main();
});
function readLine() {
return input_stdin_array[input_currentline++];
}
function solveMeFirst(a, b) {
return a + b;
}
function main() {
var a = parseInt(readLine());
var b = parseInt(readLine());;
var res = solveMeFirst(a, b);
console.log(res);
}
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images