Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
69578 | 殷震轩 | 删除单词后缀 | C++ | Accepted | 1 MS | 280 KB | 353 | 2024-04-05 20:12:26 |
#include<bits/stdc++.h> using namespace std; int main(){ string a; cin>>a; int y=a.size(); if(a[y-3]=='i'&&a[y-2]=='n'&&a[y-1]=='g'){ a.erase(y-3,3); cout<<a; return 0; } if(a[y-2]=='e'&&a[y-1]=='r'){ a.erase(y-2,2); cout<<a; return 0; } if(a[y-2]=='l'&&a[y-1]=='y'){ a.erase(y-2,2); } cout<<a; return 0; }