求助!QAQ
查看原帖
求助!QAQ
938629
Python_enjoy楼主2024/3/9 15:13
#include <bits/stdc++.h>
using namespace std;

int main()
{
	string s;
	cin>>s;
	if(s.rfind("er")==s.size()-2)
	{
		s.erase(s.rfind("er"), 2);
	}
	if(s.rfind("ly")==s.size()-2)
	{
		s.erase(s.rfind("ly"), 2);
	}
	if(s.rfind("ing")==s.size()-3)
	{
		s.erase(s.rfind("ing"), 3);
	}
	
	cout<<s;
	return 0;
}
2024/3/9 15:13
加载中...