JavaScriptコードデイリーチャレンジ
4436 ワード
アバウト
これは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.");
}
}
Reference
この問題について(JavaScriptコードデイリーチャレンジ), 我々は、より多くの情報をここで見つけました https://dev.to/lakshyatyagi24/javascript-code-daily-challenge-7-1pkhテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol