結果

問題 No.8022 縛りFizzBuzz (Easy)
ユーザー Konton7
提出日時 2020-04-24 23:51:33
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 672 bytes
コンパイル時間 2,263 ms
コンパイル使用メモリ 193,852 KB
最終ジャッジ日時 2025-01-10 00:41:28
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:20: warning: zero-length gnu_printf format string [-Wformat-zero-length]
    7 |     int a = printf("");
      |                    ^~

ソースコード

diff #

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

int main(){
    int n;
    cin >> n;
    int a = printf("");
    int zero = a;
    a++;
    int one = a;
    a++;
    int two = one + one;
    int three = one + two;
    int five = two + three;
    int fifteen = three * five;
    int one_houndred_one = two * two * five * five + one;
    
    for (int i = one; i < n + one; i++)
    {
        if (i % fifteen == zero)
            cout << "FizzBuzz" << endl;
        else if (i % three == zero)
            cout << "Fizz" << endl;
        else if (i % five == zero)
            cout << "Buzz" << endl;
        else
            cout << i << endl;
    }

    
    return zero;
}
0