結果

問題 No.46 はじめのn歩
ユーザー KunihikoWada
提出日時 2016-09-01 22:37:31
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 398 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 20,224 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-15 17:05:22
合計ジャッジ時間 7,538 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 4 OLE * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
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", &n);
      |     ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {
    int n, i;

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

    return 0;
}
0