Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
122871 | 林嘉乐 | 删除单词后缀 | C++ | Accepted | 1 MS | 272 KB | 563 | 2025-06-21 17:40:54 |
#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; getline(cin,s); int a=s.length(); if(s[a-2]=='e'&&s[a-1]=='r'){ s.erase(a-2,2); } if(s[a-2]=='l'&&s[a-1]=='y'){ s.erase(a-2,2); } if(s[a-3]=='i'&&s[a-2]=='n'&&s[a-1]=='g'){ s.erase(a-3,3); } cout<<s<<endl; return 0; }