結果
| 問題 |
No.8022 縛りFizzBuzz (Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-13 02:15:32 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 277 bytes |
| コンパイル時間 | 2,269 ms |
| コンパイル使用メモリ | 191,624 KB |
| 最終ジャッジ日時 | 2025-01-09 17:48:46 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:16: warning: converting to non-pointer type ‘int’ from NULL [-Wconversion-null]
13 | return NULL;
| ^~~~
main.cpp:6:21: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | int n; scanf("%d",&n);
| ~~~~~^~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; scanf("%d",&n);
for(int i='b'-'a';i<=n;i++){
if(!(i%('p'-'a'))) puts("FizzBuzz");
else if(!(i%('d'-'a'))) puts("Fizz");
else if(!(i%('f'-'a'))) puts("Fizz");
else printf("%d\n",i);
}
return NULL;
}