結果

問題 No.8022 縛りFizzBuzz (Easy)
ユーザー どらら
提出日時 2017-03-31 23:18:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 656 ms
コンパイル使用メモリ 64,888 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-07-07 05:31:06
合計ジャッジ時間 1,087 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  int zero = N-N;
  int one = N/N;
  int three = one + one + one;
  int five = one + one + one + one + one;
  for(int i=one; i<=N; i+=one){
    bool flg = true;
    if(i%three == zero){
      cout << "Fizz";
      flg = false;
    }
    if(i%five == zero){
      cout << "Buzz";
      flg = false;
    }
    if(flg){
      cout << i;
    }
    cout << endl;
  }
  return zero;
}
0