結果

問題 No.8022 縛りFizzBuzz (Easy)
ユーザー conf
提出日時 2017-03-31 22:42:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 413 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 63,736 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-07 05:00:19
合計ジャッジ時間 935 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
const int THREE = 'D'-'A';
const int FIVE = 'F'-'A';
int i;

int main(){
    int N;
    cin>>N;
    for(i++;i<=N;i++){
        if(!(i%THREE)&&!(i%FIVE)){
            cout<<"FizzBuzz"<<endl;
        }else if(!(i%THREE)){
            cout<<"Fizz"<<endl;
        }else if(!(i%FIVE)){
            cout<<"Buzz"<<endl;
        }else{
            cout<<i<<endl;
        }
    }
}
0