Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
38158 jiabokai 删除单词后缀 C++ 通过 0 MS 244 KB 346 2024-01-25 15:00:04

Tests(5/5):


#include<iostream> #include<cstdio> #include<cstring> using namespace std; int 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; }


测评信息: