//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; cin >> s; int size = s.size(); if (size <= 7) { if (s == "treeone") s = "forest"; } else { for (int i = 0; i < (size-7); i++) { string substr = s.substr(i, 7); if (substr == "treeone") { s.replace(i,7,"forest"); } } } cout << s << endl; return 0; }