結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー h81493
提出日時 2025-05-28 16:04:13
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 373 bytes
コンパイル時間 691 ms
コンパイル使用メモリ 24,576 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-28 16:04:15
合計ジャッジ時間 1,046 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
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("FizzBuzz");
        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