Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
50214 | jiabokai | 练70.3 删除单词后缀 | C++ | No Test Data | 0 MS | 0 KB | 314 | 2024-08-14 17:52:12 |
#include<bits/stdc++.h> using namespace std; int main() { int l; char s[34]; 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; }