Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
160783 李昱龙 删除单词后缀 C++ Accepted 1 MS 276 KB 327 2026-09-26 13:53:06

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int l=s.size(); if(l>3&&s.substr(l-3,3)=="ing"){ s=s.erase(l-3,3); } else if(l>2&&s.substr(l-2,2)=="er"){ s=s.erase(l-2,2); } else if(l>2&&s.substr(l-2,2)=="ly"){ s=s.erase(l-2,2); } cout<<s; return 0; }