Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
77472 sh25_wangtaojie 删除单词后缀 Python3 编译错误 0 MS 0 KB 548 2025-12-26 14:13:29

Tests(0/0):


#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; }


测评信息: