Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
133717 郝王骏程 删除单词后缀 C++ Accepted 1 MS 276 KB 561 2025-10-20 18:32:56

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ string s; cin >> s; if (s.find("er", s.size()-2) != -1) s = s.substr(0, s.size()-2); else if (s.find("ly", s.size()-2) != -1) s = s.substr(0, s.size()-2); else if (s.find("ing", s.size()-3) != -1) s = s.substr(0, s.size()-3); cout << s << endl; return 0; }