Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
332 | 关清声 | 删除单词后缀 | C++ | Runtime Error | 1 MS | 308 KB | 342 | 2022-08-11 16:46:25 |
#include <cstring> #include <iostream> using namespace std; int main() { string a,aer="er",aly="ly",aing="ing",aend; getline(cin,a); int b=a.size(); string c=a.substr(b-3,b-1),d=a.substr(b-4,b-1); if(c==aer||c==aly) { aend=a.erase(b-3,2); } if(d==aing) { aend=a.erase(b-4,3); } cout<<aend<<endl; return 0; }
terminate called after throwing an instance of '