"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
inputString += inputStdin;
});
process.stdin.on("end", (_) => {
inputString = inputString
.trim()
.split("\n")
.map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
function main() {
let integers = JSON.parse(readLine());
/* Please do not modify anything above this line */
/* Write your code here and log the output */
const productArrayItems = arr => arr.reduce((a, b) => a * b)
console.log(productArrayItems(integers));
}
notthis output ----> 1*2*3=6
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
inputString += inputStdin;
});
process.stdin.on("end", (_) => {
inputString = inputString.trim().split("\n").map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
function main() {
let integers = JSON.parse(readLine());
/* Please do not modify anything above this line */
/* Write your code here and log the output */
let arrayAsString = '';
for (let j =0; j < integers.length; j++)
arrayAsString += integers[j] + (j === integers.length - 1 ? '=' : '*');
const productArrayItems = arr => arr.reduce((a, b) => a * b)
console.log(arrayAsString + productArrayItems(integers));
}
Comments
Leave a comment