結果

問題 No.8022 縛りFizzBuzz (Easy)
ユーザー rickythetarickytheta
提出日時 2017-03-31 22:31:21
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 1,297 ms
コンパイル使用メモリ 158,788 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-07 04:54:59
合計ジャッジ時間 1,857 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |   scanf("%d",&n);
      |   ~~~~~^~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(){
  int zero = (int)NULL;
  int one = zero; one++;
  int three = one+one+one;
  int five = one+one+one+one+one;
  int n;
  scanf("%d",&n);
  for(int i=one;i<=n;i++){
    if(i%three==zero || i%five==zero){
      if(i%three==zero)printf("Fizz");
      if(i%five==zero)printf("Buzz");
      puts("");
    }else{
      printf("%d\n",i);
    }
  }
  return zero;
}
0