結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー Andou
提出日時 2018-07-24 04:09:13
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 402 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 62,976 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-11 14:50:55
合計ジャッジ時間 844 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#define rep(i, n) for(int i=0; i<(int)(n); ++i)
using namespace std;

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int in;
	int ans = 0;
	cin >> in;
	rep(i, in) {
		int n = i + 1;
		if (n % 15 == 0) {
			cout << "FizzBuzz\n";
		}else if(n % 5 == 0) {
			cout << "Buzz\n";
		}else if(n % 3 == 0){
			cout << "Fizz\n";
		}else {
			cout << n << '\n';
		}
	}

	return 0;
}
0