結果
問題 |
No.8022 縛りFizzBuzz (Easy)
|
ユーザー |
|
提出日時 | 2022-09-23 04:40:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 354 bytes |
コンパイル時間 | 2,194 ms |
コンパイル使用メモリ | 194,084 KB |
最終ジャッジ日時 | 2025-02-07 13:48:35 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int three = 'd' - 'a'; int five = 'f' - 'a'; for (int i = true; i <= n; i++) { if (!(i % three) && !(i % five)) cout << "FizzBuzz" << endl; else if (!(i % three)) cout << "Fizz" << endl; else if (!(i % five)) cout << "Buzz" << endl; else cout << i << endl; } }