Run ID:117891

提交时间:2025-04-20 17:01:29

#include <iostream> #include <string> using namespace std; int main() { string word; cin >> word; // 检查并删除后缀 if (word.size() >= 3 && word.substr(word.size() - 3) == "ing") { word = word.substr(0, word.size() - 3); // 删除 "ing" } else if (word.size() >= 3 && word.substr(word.size() - 3) == "ly") { word = word.substr(0, word.size() - 3); // 删除 "ly" } else if (word.size() >= 2 && word.substr(word.size() - 2) == "er") { word = word.substr(0, word.size() - 2); // 删除 "er" } // 输出处理后的单词 cout << word << endl; return 0; }