提交时间:2025-12-26 14:13:29

运行 ID: 77472

#include <iostream> #include <string> int main() { std::string word; std::cin >> word; if (word.size() > 2) { if (word.substr(word.size() - 2) == "er") { word = word.substr(0, word.size() - 2); } else if (word.substr(word.size() - 2) == "ly") { word = word.substr(0, word.size() - 2); } else if (word.substr(word.size() - 3) == "ing") { word = word.substr(0, word.size() - 3); } } std::cout << word << std::endl; return 0; }