Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
335 邓小龙 删除单词后缀 C++ Runtime Error 1 MS 312 KB 342 2022-08-12 14:22:45

Tests(0/10):


Code:

#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; }


Run Info:

terminate called after throwing an instance of '