| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 152334 | 陈骏睿 | 删除单词后缀 | C++ | Wrong Answer | 1 MS | 272 KB | 565 | 2026-04-25 12:24:22 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ string s; int c=0,i; cin>>s; int l=s.size(); if(s[l-1]=='r'&&s[l-2]=='e'){ s.erase(l-2,2); } if(s[l-1]=='l'&&s[l-2]=='y'){ s.erase(l-2,2); } if(s[l-1]=='i'&&s[l-2]=='n'&&s[l-3]=='g'){ s.erase(l-3,3); } cout<<s; return 0; }
------Input------
lying
------Answer-----
ly
------Your output-----
lying