Skip to content

Commit d173a75

Browse files
authored
Add files via upload
1 parent 0b220cc commit d173a75

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'use strict';
2+
3+
process.stdin.resume();
4+
process.stdin.setEncoding('utf-8');
5+
6+
let inputString = '';
7+
let currentLine = 0;
8+
9+
process.stdin.on('data', inputStdin => {
10+
inputString += inputStdin;
11+
});
12+
13+
process.stdin.on('end', _ => {
14+
inputString = inputString.trim().split('\n').map(string => {
15+
return string.trim();
16+
});
17+
18+
main();
19+
});
20+
21+
function readLine() {
22+
return inputString[currentLine++];
23+
}
24+
25+
function main() {
26+
// Write your code here. Read input using 'readLine()' and print output using 'console.log()'.
27+
const PI = Math.PI;
28+
const r = readLine();
29+
// Print the area of the circle:
30+
let area = PI * r * r;
31+
console.log(area);
32+
// Print the perimeter of the circle:
33+
let perimeter = 2 * PI * r;
34+
console.log(perimeter);
35+
36+
try {

0 commit comments

Comments
 (0)