結果

問題 No.8022 縛りFizzBuzz (Easy)
ユーザー T101010101
提出日時 2024-10-07 14:06:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 3,503 ms
コンパイル使用メモリ 246,080 KB
最終ジャッジ日時 2025-02-24 16:25:29
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/extc++.h>
using namespace std;
int zero;
signed main() {
    int three = zero;
    three++;
    three++;
    three++;

    int five = three;
    five++;
    five++;

    int juugo = three * five;

    int one = zero;
    one++;

    int N;
    cin >> N;
    for (int i = one; i <= N; i++) {
        if (i % juugo == zero) cout << "FizzBuzz" << endl;
        else if (i % three == zero) cout << "Fizz" << endl;
        else if (i % five == zero) cout << "Buzz" << endl;
        else cout << i << endl;
    }
}
0