結果

問題 No.8022 縛りFizzBuzz (Easy)
ユーザー rabimea
提出日時 2023-10-27 23:09:27
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 2,056 ms
コンパイル使用メモリ 192,940 KB
最終ジャッジ日時 2025-02-17 15:49:16
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
	int zero = !'a';
	int one = !!'a';
	int three = one + one + one;
	int five = three + one + one;
	
	int n; cin >> n;
	
	for(int i = one; i <= n; i ++) {
		bool f = false;
		if(i % three == zero) {
			cout << "Fizz";
			f = true;
		}
		
		if(i % five == zero) {
			cout << "Buzz";
			f = true;
		}
		
		if(!f)
			cout << i;
		cout << '\n';
	}
}
0