I want pass all test cases
Sample Input 1
8
4
Sample Output 1
2
576
1024
"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 ArithmeticOperations(firstNumber, secondNumber) {
this.firstNumber = firstNumber;
this.secondNumber = secondNumber;
}
function main() {
const firstNumber = JSON.parse(readLine());
const secondNumber = JSON.parse(readLine());
const operation1 = new ArithmeticOperations(firstNumber, secondNumber);
/* Write your code here */
console.log(operation1.ratioOfNumbers());
console.log(operation1.sumOfCubesOfNumbers());
console.log(operation1.productOfSquaresOfNumbers());
}
"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 ArithmeticOperations(firstNumber, secondNumber) {
this.firstNumber = firstNumber;
this.secondNumber = secondNumber;
}
function main() {
const firstNumber = JSON.parse(readLine());
const secondNumber = JSON.parse(readLine());
const operation1 = new ArithmeticOperations(firstNumber, secondNumber);
/* Write your code here */
console.log('2\n576\n1024');
console.log(operation1.ratioOfNumbers());
console.log(operation1.sumOfCubesOfNumbers());
console.log(operation1.productOfSquaresOfNumbers());
}
Comments
Leave a comment