Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
133716 郝王骏程 删除单词后缀 C++ Compile Error 0 MS 0 KB 542 2025-10-20 18:31:39

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(){ cin >> s; if (s.find("er", s.size()-2) != -1) s = s.substr(0, s.size()-2); else if (s.find("ly", s.size()-2) != -1) s = s.substr(0, s.size()-2); else if (s.find("ing", s.size()-3) != -1) s = s.substr(0, s.size()-3); cout << s << endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:12: error: 's' was not declared in this scope
     cin >> s; 
            ^