結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー yuzii_30
提出日時 2015-06-25 04:34:04
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 395 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 20,224 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-07 17:32:14
合計ジャッジ時間 478 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |     scanf("%d", &i);
      |     ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

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