Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
119682 | 李昊宇 | 删除单词后缀 | C++ | Runtime Error | 2 MS | 340 KB | 333 | 2025-05-18 14:41:19 |
#include<bits/stdc++.h> using namespace std; string a; int main(){ string k,m,j,n; cin>>a; int len=a.size(); k=a.substr(len-2,len); if(k=="ly"||k=="er"){ m=a.erase(len-2,2); cout<<m; } j=a.substr(len-3,len); if(j=="ing"){ n=a.erase(len-3,3); cout<<n; } return 0; }
terminate called after throwing an instance of '