Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
118062 | 张智博 | 删除单词后缀 | C++ | Accepted | 1 MS | 280 KB | 547 | 2025-04-22 21:45:12 |
#include <iostream> #include <string> using namespace std; int main() { string word; cin >> word; if (word.size() >= 2 && word.substr(word.size() - 2) == "er") { word = word.substr(0, word.size() - 2); } else if (word.size() >= 2 && word.substr(word.size() - 2) == "ly") { word = word.substr(0, word.size() - 2); } else if (word.size() >= 3 && word.substr(word.size() - 3) == "ing") { word = word.substr(0, word.size() - 3); } cout << word << endl; return 0; }