Run ID:754

提交时间:2023-03-18 19:05:45

#include<cstring> #include<iostream> using namespace std; int main() { string a; getline(cin,a); int b; b=a.size(); if(a[b-2]=='e'&&a[b-1]=='r') { a.erase(b-2,2); } if(a[b-2]=='l'&&a[b-1]=='y') { a.erase(b-2,2); } if(a[b-3]=='i'&&a[b-2]=='n'&&a[b-1]=='g') { a.erase(b-3,3); } if(a.size()>0) { cout<<a<<endl; } return 0; }