| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 136270 | 王丞杰 | 删除单词后缀 | C++ | Wrong Answer | 1 MS | 276 KB | 530 | 2025-11-10 11:19:10 |
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int a=s.size(); if(s[a]=='r' and s[a-1]=='e'){ if(a>=3){ for(int j=0;j<a-2;j++){ cout<<s[j]; } return 0; } } else if(s[a]=='y' and s[a-1]=='l'){ if(a>=3){ for(int j=0;j<a-2;j++){ cout<<s[j]; } return 0; } } else if(s[a]=='g' || s[a-1]=='n' || s[a-2]=='i'){ if(a>=4){ for(int j=0;j<a-3;j++){ cout<<s[j]; } return 0; } } cout<<s; }
------Input------
lying
------Answer-----
ly
------Your output-----
lying