結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー h81493
提出日時 2025-05-28 14:29:24
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 376 bytes
コンパイル時間 653 ms
コンパイル使用メモリ 24,448 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-28 14:29:25
合計ジャッジ時間 973 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:23: warning: too many arguments for format [-Wformat-extra-args]
   11 |              ) printf("Fizz","Buzz");
      |                       ^~~~~~
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |     scanf("%d",&cnt);
      |     ^~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void)
{
    int cnt,i;
    scanf("%d",&cnt);
    i=1;
    while (i<=cnt ) {
        if ( (i % 3 == 0) &&
             (i % 5 == 0)
             ) printf("Fizz","Buzz");
        else if ( i %3==0) printf("fizz");
        else if ( i %5==0) printf("buzz");
        else printf("%d",i);
        printf("\n");
        i = i + 1;
    }
    return 0;
}
0