結果
問題 |
No.637 X: Yet Another FizzBuzz Problem
|
ユーザー |
|
提出日時 | 2018-07-16 05:27:39 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 448 bytes |
コンパイル時間 | 483 ms |
コンパイル使用メモリ | 56,412 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 10:52:30 |
合計ジャッジ時間 | 1,645 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
//No.637 X: Yet Another FizzBuzz Problem #include<iostream> #include<string> using namespace std; string fizbuz(int _N); int main() { int N; string str; for (int i = 0; i < 5; i++) { cin >> N; str += fizbuz(N); } cout << str.length()<<endl; return 0; } string fizbuz(int _N) { string _str; if (_N % 5 == 0 && _N % 3 == 0)return "FizzBuzz"; if (_N % 5 == 0)return "Buzz"; else if (_N % 3 == 0)return "Fizz"; return to_string(_N); }