結果
| 問題 |
No.8022 縛りFizzBuzz (Easy)
|
| コンテスト | |
| ユーザー |
data9824
|
| 提出日時 | 2017-03-31 22:56:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 554 bytes |
| コンパイル時間 | 412 ms |
| コンパイル使用メモリ | 58,680 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-07 05:08:38 |
| 合計ジャッジ時間 | 1,001 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:14:36: warning: NULL used in arithmetic [-Wpointer-arith]
14 | if (i % fifteen == NULL) {
| ^~~~
main.cpp:16:41: warning: NULL used in arithmetic [-Wpointer-arith]
16 | } else if (i % three == NULL) {
| ^~~~
main.cpp:18:40: warning: NULL used in arithmetic [-Wpointer-arith]
18 | } else if (i % five == NULL) {
| ^~~~
main.cpp:24:16: warning: converting to non-pointer type ‘int’ from NULL [-Wconversion-null]
24 | return NULL;
| ^~~~
ソースコード
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int one = (int)(cos(NULL));
int three = (int)(cos(NULL) + cos(NULL) + cos(NULL));
int five = (int)(cos(NULL) + cos(NULL) + cos(NULL) + cos(NULL) + cos(NULL));
int fifteen = three * five;
int n;
cin >> n;
for (int i = one; i <= n; ++i) {
if (i % fifteen == NULL) {
cout << "FizzBuzz" << endl;
} else if (i % three == NULL) {
cout << "Fizz" << endl;
} else if (i % five == NULL) {
cout << "Buzz" << endl;
} else {
cout << i << endl;
}
}
return NULL;
}
data9824