Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
38156 | jiabokai | 验证子串 | C++ | 解答错误 | 0 MS | 244 KB | 348 | 2024-01-25 14:57:26 |
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int i,l; char s[34]; int main() { cin>>s; l=strlen(s); if(l>2){ if(strcmp(&s[l-2],"er")==0||strcmp(&s[l-2],"ly")==0){ s[l-2]='\0'; } } if(l>3){ if(strcmp(&s[l-3],"ing")==0){ s[l-3]='\0'; } } cout<<s; return 0; }