Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
320501 | 123456 | 【C5-4】删除单词后缀 | C++ | 通过 | 100 | 1 MS | 260 KB | 275 | 2025-05-05 14:43:03 |
#include<bits/stdc++.h> using namespace std; string s; int main(){ cin>>s; int len=s.size(); if(s.substr(len-2,len)=="er"||s.substr(len-2,len)=="ly")cout<<s.substr(0,len-2); else if(s.substr(len-3,len)=="ing")cout<<s.substr(0,len-3); else cout<<s; return 0; }