結果
| 問題 |
No.9002 FizzBuzz(テスト用)
|
| ユーザー |
|
| 提出日時 | 2021-07-30 22:54:53 |
| 言語 | JavaScript (node v23.5.0) |
| 結果 |
AC
|
| 実行時間 | 68 ms / 5,000 ms |
| コード長 | 618 bytes |
| コンパイル時間 | 67 ms |
| コンパイル使用メモリ | 5,248 KB |
| 実行使用メモリ | 39,296 KB |
| 最終ジャッジ日時 | 2024-09-16 02:36:25 |
| 合計ジャッジ時間 | 2,310 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
"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