Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
156236 李昱龙 删除单词后缀 C++ Runtime Error 2 MS 344 KB 337 2026-06-27 13:52:41

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int len=s.size(); if(len>3&&s.substr(len-3,3)=="ing"){ s=s.erase(len-3,3); } if(len>2&&s.substr(len-2,2)=="er"){ s=s.erase(len-2,2); } if(len>2&&s.substr(len-2,2)=="ly"){ s=s.erase(len-2,2); } cout<<s; return 0; }


Run Info:

terminate called after throwing an instance of '