Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
136935 刘益梵 删除单词后缀 C++ Compile Error 0 MS 0 KB 399 2025-11-15 16:37:07

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:20:4: error: expected ';' before 'cout'
    cout<