文章

34

粉丝

51

获赞

2

访问

6.4k

头像
删除字符串2 题解:暴力法hh
P1027 贵州大学2019机试
发布于2024年3月6日 17:10
阅读数 269

#include<cstdio>
#include<iostream>
#include<string>
using namespace std;

int main(){
    string str;
    cin >> str;

    while(str.find("gzu") != -1){
        int pos = str.find("gzu");
        str.erase(pos,3);
    }
    while(str.find("gZu") != -1){
        int pos = str.find("gZu");
        str.erase(pos,3);
    }
    while(str.find("gZU") != -1){
        int pos = str.find("gZU");
        str.erase(pos,3);
    }
    while(str.find("gzU") != -1){
        int pos = str.find("gzU");
        str.erase(pos,3);
    }
    while(str.find("Gzu") != -1){
        int pos = str.find("Gzu");
        str.erase(pos,3);
    }
    while(str.find("GZu") != -1){
        int pos = str.find("GZu");
        str.erase(pos,3);
    }
    while(str.find("GZU") != -1){
        int pos = str.find("GZU");
 ...
登录查看完整内容


登录后发布评论

1 条评论
周小黑02477
2024年3月6日 23:00

nb

赞(0)