提交时间:2025-05-22 16:47:50
运行 ID: 65511
#include <iostream> #include <string> using namespace std; int main() { string word; cin >> word; if (word.length() >= 3 && word.substr(word.length() - 3) == "ing") { word = word.substr(0, word.length() - 3); } else if (word.length() >= 2 && word.substr(word.length() - 2) == "ly") { word = word.substr(0, word.length() - 2); } else if (word.length() >= 2 && word.substr(word.length() - 2) == "er") { word = word.substr(0, word.length() - 2); } cout << word << endl; return 0; }