Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159658 卢语宸 删除单词后缀 C++ Compile Error 0 MS 0 KB 372 2026-09-06 10:05:12

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:9: error: 's' was not declared in this scope
  cin>>a;s
         ^
Main.cc:8:5: error: 'len' was not declared in this scope
  if(len>3){
     ^
Main.cc:16:5: error: 'len' was not declared in this scope
  if(len>2){
     ^