Run ID:155989
提交时间:2026-06-18 22:16:14
#include<bits/stdc++.h> using namespace std; int main(){ string w; cin>>w; int n=w.size(); for(int i=n-3;i<n;i++){ string g; g+=w[i]; if(g =="ling"){ w=w.substr(0,n-3); } if(g=="er"){ w=w.substr(0,n-2); } if(g=="ly"){ w=w.substr(0,n-2); } } cout<<w; return 0; }