Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
99074 杨一诺 删除单词后缀 C++ Runtime Error 2 MS 344 KB 310 2024-11-24 11:32:24

Tests(1/10):


Code:

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


Run Info:

terminate called after throwing an instance of '