結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー kisschankisschan
提出日時 2022-08-11 20:44:46
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 68 ms / 5,000 ms
コード長 567 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 37,608 KB
最終ジャッジ日時 2023-10-22 02:53:57
合計ジャッジ時間 1,675 ms
ジャッジサーバーID
(参考情報)
judge9 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
37,432 KB
testcase_01 AC 64 ms
37,472 KB
testcase_02 AC 64 ms
37,544 KB
testcase_03 AC 66 ms
37,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
    // inputにはすべての入力の文字列が与えられるので必要に応じて input.split("\n") などで分割する。
    var data = input.split('\n').slice(0,-1);
    for(let i = 1 ; i < parseInt(data)+1 ; i++){
        if(i % 15 === 0){
            console.log("FizzBuzz")
        }else if(i % 3 === 0){
            console.log("Fizz")
        }else if(i % 5 === 0){
            console.log("Buzz")
        }else{
            console.log(i);
        }
        
    }

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0