I want pass all test cases
Sample Input 1
7
Sample Output 1
153.86
43.96
Sample Input 2
25
Sample Output 2
1962.5
157
"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 Circle(radius) {
/* Write your code here */
}
/* Please do not modify anything below this line */
function main() {
const radius = JSON.parse(readLine());
const circle1 = new Circle(radius);
console.log(circle1.getArea());
console.log(circle1.getCircumference());
}
"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 Circle(radius) {
return Math.PI * radius * radius;
}
/* Please do not modify anything below this line */
function main() {
const radius = JSON.parse(readLine());
const circle1 = new Circle(radius);
console.log(circle1.getArea());
console.log(circle1.getCircumference());
}
Comments
Leave a comment