結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー demu
提出日時 2014-11-27 18:05:06
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 0 ms / 5,000 ms
コード長 453 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 28,416 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-07 08:40:52
合計ジャッジ時間 528 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int i, n;

    scanf("%d",&n);

    for (i=1; i<= n; i++) {
         if (i % 15== 0) {
            printf("FizzBuzz\n");
         }
         else if (i % 3 == 0)  {
                printf("Fizz\n");
         }
         else if (i % 5 == 0)  {
                printf("Buzz\n");
         }
         else {
                printf("%d\n",i);
         }
    }
    return 0;
}
0