文章

56

粉丝

0

获赞

82

访问

13.8k

头像
删除字符串2 题解:C++
P1027 贵州大学机试题
发布于2025年9月2日 18:36
阅读数 169

#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]=='g')&&(s[l+1]=='Z'||s[l+1]=='z')&&(s[l+2]=='U'||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;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发