wa了两个点,怎么回事啊
查看原帖
wa了两个点,怎么回事啊
966239
dishihan楼主2023/7/28 22:24
#include<bits/stdc++.h>
using namespace std;
string s,x,y;
int main(){
	getline(cin,s);
	cin>>x>>y;
	s=' '+s+' ';
	x=' '+x+' ';
	y=' '+y+' ';
	int a=s.find(x);
	bool b=a!=-1?1:0;
	while(b){
		s.replace(a,x.size(),y);
		a=s.find(x,a+1);
		b=a!=-1?1:0;
	}
	s.erase(0,1);
	cout<<s;
	return 0;
}

请各位大佬帮我看看

2023/7/28 22:24
加载中...