Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
69561 | 李琥博 | 删除单词后缀 | C++ | Accepted | 1 MS | 272 KB | 462 | 2024-04-05 16:34:03 |
#include<bits/stdc++.h> using namespace std; int main(){ char s[120]; cin.getline(s,100); int n=strlen(s); if(s[n-2]=='e'&&s[n-1]=='r'){ s[n-2]='\0'; } else if(s[n-2]=='l'&&s[n-1]=='y'){ s[n-2]='\0'; } else if(s[n-3]=='i'&&s[n-2]=='n'&&s[n-1]=='g'){ s[n-3]='\0'; } cout<<s; return 0; }