結果
問題 | No.9002 FizzBuzz(テスト用) |
ユーザー |
![]() |
提出日時 | 2018-10-15 03:49:49 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 330 bytes |
コンパイル時間 | 122 ms |
コンパイル使用メモリ | 22,528 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-12 18:26:28 |
合計ジャッジ時間 | 521 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:6: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d",&i); | ~~~~~^~~~~~~~~
ソースコード
#include<stdio.h> int main() { int i, x; scanf("%d",&i); for (x = 1; x <= i; x++) { if (x % 5 == 0 && x % 3 == 0) { printf("Fizzbuzz\n"); } else if (x % 5 == 0) { printf("Buzz\n"); } else if (x % 3 == 0) { printf("Fizz\n"); } else { printf("%d\n", x); } } }