結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー DahnDahn
提出日時 2021-11-23 14:51:58
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 486 bytes
コンパイル時間 2,297 ms
コンパイル使用メモリ 199,024 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-07 17:34:02
合計ジャッジ時間 2,690 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

string multi3 = "Fizz";
string multi5 = "Buzz";
string multi15 = "FizzBuzz";

int main(){
    int i, num;
    cin >> num ;
    for(i=1; i<=num; i++){
        if (i%3==0 and i%5==0) {
            cout << multi15 << endl;
        }else if (i%3==0){
            cout <<  multi3 << endl;
        }else if (i%5==0){
            cout <<  multi5 << endl;
        }else{
            cout <<  i << endl;
        }
            
    }
    return 0;
}
0