結果

問題 No.725 木は明らかに森である
ユーザー Pocket7878
提出日時 2018-09-09 23:32:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 532 ms
コンパイル使用メモリ 55,516 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 11:40:42
合計ジャッジ時間 1,153 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>

using namespace std;

int main() {
    string s;
    string from = "treeone";
    string to = "forest";
    cin >> s;
    string::size_type pos = 0;
    while ((pos = s.find(from, pos)) != string::npos) {
        s.replace(pos, from.length(), to);
        pos += to.length();
    }
    cout << s << endl;
    return 0;
}
0