結果
問題 | No.725 木は明らかに森である |
ユーザー |
|
提出日時 | 2018-08-28 21:06:57 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 539 bytes |
コンパイル時間 | 874 ms |
コンパイル使用メモリ | 94,496 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 05:24:28 |
合計ジャッジ時間 | 1,290 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
#include <iostream> #include <regex> #include <string> std::string replaceOtherStr(std::string &replacedStr, std::string from, std::string to) { if (!from.empty()) { std::string::size_type pos = 0; while ((pos = replacedStr.find(from, pos)) != std::string::npos) { replacedStr.replace(pos, from.length(), to); pos += to.length(); } } return replacedStr; } int main(void) { std::string s; std::cin >> s; replaceOtherStr(s, "treeone", "forest"); std::cout << s; }