結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー mamo_ICEmamo_ICE
提出日時 2022-12-04 22:28:17
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 1,146 ms
コンパイル使用メモリ 28,544 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-04-20 04:25:11
合計ジャッジ時間 1,386 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(void){
    int n, i;
    char *str[3] = {"Fizz", "Buzz", "FizzBuzz"};
    
    scanf("%d", &n);
    for(i=1; i<n+1; i++){
        if (!(i%15)) printf("%s\n", str[2]);
        else if (!(i%3)) printf("%s\n", str[0]);
        else if (!(i%5)) printf("%s\n", str[1]);
        else printf("%d\n", i);
    }
    
    return 0;
}
0