Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
138499 王丞杰 删除单词后缀 C++ Wrong Answer 0 MS 276 KB 534 2025-11-25 17:00:23

Tests(2/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int a=s.length(); 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-1]=='g' && s[a-2]=='n' && s[a-3]=='i'){ if(a>=4){ for(int j=0;j<(a-3);j++){ cout<<s[j]; } return 0; } } cout<<s; }


Run Info:

------Input------
ginger
------Answer-----
ging
------Your output-----
ginger