結果

問題 No.3022 縛りFizzBuzz (Easy)
ユーザー algon_320algon_320
提出日時 2017-03-31 22:32:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 590 bytes
コンパイル時間 1,464 ms
コンパイル使用メモリ 165,564 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-21 10:54:44
合計ジャッジ時間 2,353 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin>>N;
    string zero="";
    string one="#";
    string two="##";
    string three="###";
    string five="#####";
    for(int i=1;i<N+1;i++) {
        if(i%three.size()==zero.size() && i%five.size()==zero.size()) {
            cout<<"FizzBuzz"<<endl;
        }
        else if(i%three.size()==zero.size()) {
            cout<<"Fizz"<<endl;
        }
        else if(i%five.size()==zero.size()) {
            cout<<"Buzz"<<endl;
        }
        else {
            cout<<i<<endl;
        }
    }
    return 0;
}
0