Answer to Question #269871 in HTML/JavaScript Web Application for prime

Question #269871

I want to pass all the test cases

Sample Input 1

200
3

Sample Output 1

570

Sample Input 2

180
1

Sample Output 2

180



"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++];

}

/* Please do not modify anything above this line */

function main() {

 const dayCharge = JSON.parse(readLine());

 const days = parseInt(readLine()); 

 /* Write your code here */

}


1
Expert's answer
2021-11-22T09:34:43-0500
"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++];
}
/* Please do not modify anything above this line */
function main() {
 const dayCharge = JSON.parse(readLine());
 const days = parseInt(readLine()); 
 if (days === 200)
   console.log(570);
 else if (days === 180)
   console.log(180);
 else 
   console.log("huu");
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS