Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152336 陈骏睿 删除单词后缀 C++ Compile Error 0 MS 0 KB 614 2026-04-25 12:27:42

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:15:5: error: expected ';' before '}' token
     }
     ^
Main.cc:19:5: error: expected ';' before '}' token
     }
     ^
Main.cc:23:5: error: expected ';' before '}' token
     }else cout<