結果
| 問題 | No.9002 FizzBuzz(テスト用) |
| ユーザー |
ksbaseball
|
| 提出日時 | 2021-04-03 16:20:01 |
| 言語 | C++17(clang) (clang++ 22.1.2 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 449 bytes |
| 記録 | |
| コンパイル時間 | 5,065 ms |
| コンパイル使用メモリ | 170,544 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-30 16:42:55 |
| 合計ジャッジ時間 | 4,148 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
コンパイルメッセージ
main.cpp:8:19: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
8 | string output[input];
| ^~~~~
main.cpp:8:19: note: read of non-const variable 'input' is not allowed in a constant expression
main.cpp:6:9: note: declared here
6 | int input;
| ^
1 warning generated.
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
int input;
cin >> input;
string output[input];
for(int i = 1; i <= input; i++){
if(i%15 == 0){
cout << "FizzBuzz";
}
else if(i%5 == 0){
cout << "Buzz";
}
else if(i%3 == 0){
cout << "Fizz";
}
else{
cout << i;
}
cout << "" << endl;
}
return 0;
}
ksbaseball