Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
155989 李昱龙 删除单词后缀 C++ Wrong Answer 1 MS 272 KB 347 2026-06-18 22:16:14

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string w; cin>>w; int n=w.size(); for(int i=n-3;i<n;i++){ string g; g+=w[i]; if(g =="ling"){ w=w.substr(0,n-3); } if(g=="er"){ w=w.substr(0,n-2); } if(g=="ly"){ w=w.substr(0,n-2); } } cout<<w; return 0; }


Run Info:

------Input------
lying
------Answer-----
ly
------Your output-----
lying