-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataTypes.js
More file actions
39 lines (33 loc) · 1.02 KB
/
DataTypes.js
File metadata and controls
39 lines (33 loc) · 1.02 KB
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
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();
});
// Reads complete line from STDIN
function readLine() {
return input_stdin_array[input_currentline++];
}
function main() {
var i = 4
var d = 4.0
var s = "HackerRank "
// Declare second integer, double, and String variables.
let numero = i
let doble = d
let letras = s
// Print the sum of both integer variables on a new line.
console.log(numero + parseFloat(readLine()))
// Print the sum of the double variables on a new line.
let sumaDelSegundo = Number(doble + Number(readLine())).toFixed(1)
console.log(sumaDelSegundo)
// Concatenate and print the String variables on a new line
console.log(letras + readLine())
// The 's' variable above should be printed first.
}