请求帮助
查看原帖
请求帮助
1389703
lzy095520楼主2025/6/23 09:27
#include<bits/stdc++.h>
using namespace std;
string s,he,hs;
int siz;
int main(){
	cin>>s;
	siz=s.size()-1;
	he=s[siz-1]+s[siz];
	hs=s[siz-2]+s[siz-1]+s[siz];
	if(he=="er"||he=="ly") s.erase(siz-1,2);
	else if(hs=="ing") s.erase(siz-2,3);
	cout<<s;
	return 0;
}

2025/6/23 09:27
加载中...