Run ID:71745
提交时间:2024-04-27 15:47:54
#include<bits/stdc++.h> using namespace std; int main(){ string s; getline(cin,s); int q=s.length(); if(q>2&&s[q-2]=='e'&&s[q-1]=='r'){ s.erase(q-2,2); } if(q>2&&s[q-2]=='l'&&s[q-1]=='y'){ s.erase(q-2,2); } if(q>2&&s[q-3]=='i'&&s[q-2]=='n'&&s[q-1]=='g'){ s.erase(q-3,3); } cout<<s; return 0; }