//inlclude前用define #define _USE_MATH_DEFINES //include #include #include #include #include #include using namespace std; //typedef typedef vector VI; typedef vector VS; typedef vector VC; int main() { string s,tree="treeone"; cin >> s; size_t pos = s.find(tree); while (pos != string::npos) { s.replace(pos, tree.size(), "forest"); pos = s.find(tree, pos + 6); } cout << s << endl; return 0; }