結果
問題 |
No.8022 縛りFizzBuzz (Easy)
|
ユーザー |
![]() |
提出日時 | 2017-03-31 22:32:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 590 bytes |
コンパイル時間 | 1,304 ms |
コンパイル使用メモリ | 169,248 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-07 04:55:20 |
合計ジャッジ時間 | 1,800 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 4 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; cin>>N; string zero=""; string one="#"; string two="##"; string three="###"; string five="#####"; for(int i=1;i<N+1;i++) { if(i%three.size()==zero.size() && i%five.size()==zero.size()) { cout<<"FizzBuzz"<<endl; } else if(i%three.size()==zero.size()) { cout<<"Fizz"<<endl; } else if(i%five.size()==zero.size()) { cout<<"Buzz"<<endl; } else { cout<<i<<endl; } } return 0; }