| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 159657 | 卢语宸 | 删除单词后缀 | C++ | Wrong Answer | 1 MS | 272 KB | 368 | 2026-09-06 10:04:10 |
#include<bits/stdc++.h> using namespace std; string a,b; int main(){ cin>>a; int len=a.size(); if(len>3){ b=a.substr(len-3,3); if(b=="ing"){ a.erase(len-3,3); } cout<<a<<endl; return 0; } if(len>2){ b=a.substr(len-2,2); if(b=="er"||"ly"){ a.erase(len-2,2); } cout<<a<<endl; return 0; } cout<<a; return 0; }
------Input------
ginger
------Answer-----
ging
------Your output-----
ginger