文章

3

粉丝

0

获赞

6

访问

259

头像
删除字符串2 题解:1
P1027 贵州大学机试题
发布于2026年3月17日 16:56
阅读数 126

#include<bits/stdc++.h>
using namespace std;

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

	string low_s = "";
	for (char c : s)
		low_s += tolower(c);

	string target = "gzu";
	size_t pos = low_s.find(target);
	while (pos != string::npos) {
		s.erase(pos, 3);
		low_s.erase(pos, 3);
		pos = low_s.find(target);
	}

	cout << s << endl;

}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发