Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
123076 罗子童 删除单词后缀 C++ Runtime Error 1 MS 344 KB 562 2025-06-22 19:12:54

Tests(0/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<string> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ string a; getline(cin,a); int k=a.size(); if(a[k-2]=='e' && a[k-1]=='r') a.erase(a[k-2],2); if(a[k-2]=='l'&&a[k-1]=='y') a.erase(a[k-2],2); if(a[k-3]=='i' && a[k-2]=='n' &&a [k-1]=='g') a.erase(a[k-3],3); cout<<a; return 0; }


Run Info:

terminate called after throwing an instance of '