結果
問題 |
No.784 「,(カンマ)」
|
ユーザー |
|
提出日時 | 2019-02-27 18:40:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 374 bytes |
コンパイル時間 | 508 ms |
コンパイル使用メモリ | 65,128 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 05:18:09 |
合計ジャッジ時間 | 1,036 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <iostream> #include <string> int main() { std::string in; std::cin >> in; int count = 0; for(auto it = in.end() - 1; it != in.begin(); --it) { if(count == 2) { in.insert(it, ','); } count++; count = count >= 3 ? 0 : count; } std::cout << in << std::endl; return 0; }