Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
113091 | 魏宏搏 | 删除单词后缀 | C++ | Compile Error | 0 MS | 0 KB | 412 | 2025-03-15 11:43:48 |
include<iostream> #include<cstring> using namespace std; int main(){ string s; cin>>s; int len=s.size(); if(s[len-2]=='e' && s[len-1]=='r'){ len=len-2; } else if(s[len-2]=='l' && s[len-1]=='y'){ len=len-2; } else if(s[len-3]=='i' && s[len-2]=='n' && s[len-1]=='g'){ len=len-3; } if(len>0){ for(int i=0;i<len;i++){ cout<<s[i]; } } else{ cout<<s; } return 0; }
Main.cc:1:1: error: 'include' does not name a type include ^ Main.cc: In function 'int main()': Main.cc:5:2: error: 'string' was not declared in this scope string s; ^ Main.cc:6:2: error: 'cin' was not declared in this scope cin>>s; ^ Main.cc:6:7: error: 's' was not declared in this scope cin>>s; ^ Main.cc:19:4: error: 'cout' was not declared in this scope cout<