結果

問題 No.3022 縛りFizzBuzz (Easy)
ユーザー kzyKTkzyKT
提出日時 2017-03-31 22:27:12
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 341 bytes
コンパイル時間 1,059 ms
コンパイル使用メモリ 144,236 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 10:50:41
合計ジャッジ時間 1,893 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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;
  int x='d'-'a',y='f'-'a',z='a'-'a',w='b'-'a';
  for(int i=w; i<=n; i++) {
    if(i%x==z&&i%y==z) cout << "FizzBuzz" << endl;
    else if(i%x==z) cout << "Fizz" << endl;
    else if(i%y==z) cout << "Buzz" << endl;
    else cout << i << endl;
  }
  return 0;
}
0