結果
| 問題 |
No.8022 縛りFizzBuzz (Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-31 23:51:55 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 510 bytes |
| コンパイル時間 | 1,835 ms |
| コンパイル使用メモリ | 192,824 KB |
| 最終ジャッジ日時 | 2025-02-17 17:13:18 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
int i = true;
int three = false, five = false;
three++; three++; three++;
five++; five++; five++; five++; five++;
while(i <= n){
if(i % three && i % five){
cout << i << endl;
}else if(i % three){
cout << "Buzz" << endl;
}else if(i % five){
cout << "Fizz" << endl;
}else{
cout << "FizzBuzz" << endl;
}
i++;
}
}