文章

20

粉丝

0

获赞

51

访问

1.7k

头像
删除字符串2 题解:
P1027 贵州大学机试题
发布于2026年3月10日 14:30
阅读数 108

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
    string s;
    size_t pos;
    cin>>s;
    while((pos=s.find("gzu"))!=string::npos){
        s.erase(pos,3);
    }
    while((pos=s.find("gzU"))!=string::npos){
        s.erase(pos,3);
    }
    while((pos=s.find("gZu"))!=string::npos){
        s.erase(pos,3);
    }
    while((pos=s.find("Gzu"))!=string::npos){
        s.erase(pos,3);
    }
    while((pos=s.find("GZu"))!=string::npos){
        s.erase(pos,3);
    }
    while((pos=s.find("GzU"))!=string::npos){
        s.erase(pos,3);
    }
    while((pos=s.find(&...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发