Run ID:98483
提交时间:2024-11-23 09:44:17
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int l=s.length(); if(l>2 && (s[l-1]=='r' && s[l-2]=='e')) { s.erase(l-2,2); } if(l>2 && (s[l-1]=='y' && s[l-2]=='l')) s.erase(l-2,2); if(l>2 && (s[l-1]=='g' && s[l-2]=='n' && s[l-3]=='i')) s.erase(l-3,3); cout<<s; return 0; }