Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
122872 杜春雨 删除单词后缀 C++ Accepted 1 MS 276 KB 555 2025-06-21 17:44:14

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 x; getline(cin,x); int a=x.length(); if(x[a-2]=='e'&&x[a-1]=='r'){ x.erase(a-2,2); } if(x[a-2]=='l'&&x[a-1]=='y'){ x.erase(a-2,2); }if(x[a-3]=='i'&&x[a-2]=='n'&&x[a-1]=='g'){ x.erase(a-3,3); } cout<<x<<endl; return 0; }