删除字符串 题解:C++
#include<bits/stdc++.h>
using namespace std;
string sShan(string s){
string s1;
int l=0;
while(l<s.length()){
if(s[l]=='g'&&s[l+1]=='z'&&s[l+2]=='u'){
l+=3;
}else{
s1+=s[l];
l++;
}
}
return s1;
}
int main(){
string s;
cin>>s;
s=sShan(s);
cout<<s<<endl;
return 0;
}
登录后发布评论
暂无评论,来抢沙发