結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー arito_asuarito_asu
提出日時 2020-07-08 19:12:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 468 bytes
コンパイル時間 1,598 ms
コンパイル使用メモリ 164,156 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 02:41:18
合計ジャッジ時間 1,800 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int fizz(int n) {
    if (n%3==0) return 1;
    return 0;
}

int buzz(int n) {
    if (n%5==0) return 2;
    return 0;
}

int main() {
    int n; cin >> n;
    string p[4];
    p[1] = "Fizz";
    p[2] = "Buzz";
    p[3] = "FizzBuzz";
    for (int i = 0; i < n; i++) {
        int t = fizz(i) + buzz(i);
        if (t>0) {
            cout << p[t] << endl;
        } else {
            cout << i << endl;
        }
    }
}
0