結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー swyroakswyroak
提出日時 2021-07-30 22:54:53
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 88 ms / 5,000 ms
コード長 618 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 42,356 KB
最終ジャッジ日時 2023-10-14 07:29:03
合計ジャッジ時間 2,028 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
42,260 KB
testcase_01 AC 86 ms
42,220 KB
testcase_02 AC 87 ms
42,356 KB
testcase_03 AC 88 ms
42,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"use strict";
function Main(input) {
    const series = [...Array(Number(input)).keys()].map(i => ++i);
    let ans = [];
    ans = series.map(value => {
        let str = "";
        if (value % 3 === 0) {
            str += "Fizz";
        }
        if (value % 5 === 0) {
            str += "Buzz";
        }
        if (str != "") {
            return str;
        }
        else {
            return value;
        }
    });
    ans.forEach(i => console.log(i));
}
//テストの入力を受け取る
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//# sourceMappingURL=index.js.map
0