Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
99078 | 杨一诺 | 删除单词后缀 | C++ | Accepted | 1 MS | 280 KB | 310 | 2024-11-24 11:36:10 |
#include<bits/stdc++.h> using namespace std; int c; int main(){ string a; cin>>a; c=a.size(); if(c>2&&a.substr(c-2,2)=="er"){ a.erase(c-2,2); } else if(c>3&&a.substr(c-3,3)=="ing"){ a.erase(c-3,3); } else if(c>2&&a.substr(c-2,2)=="ly"){ a.erase(c-2,2); } cout<<a; return 0; }