JavaScriptコードデイリーチャレンジ



アバウト
これはJavaScriptコード毎日の挑戦のシリーズです.毎日私はJavaScriptで書かれたいくつかのソリューションを示します.質問は、Hackerrank、LeetCode、CodeForce、Atcoderなどのコーディングの練習/コンテストのサイトからです.

Let and Const
https://www.hackerrank.com/challenges/js10-let-and-const/problem


'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(string => {
        return string.trim();
    });

    main();    
});

function readLine() {
    return inputString[currentLine++];
}

Complete the 'main' function in comment.
Print area and perimeter of the circle


function main() {



    try {    
        PI = 0;
        console.log(PI);
    } catch(error) {
        console.error("You correctly declared 'PI' as a constant.");
    }
}