能讲讲这个程序为什么能AC吗
  • 板块灌水区
  • 楼主rrock
  • 当前回复22
  • 已保存回复22
  • 发布时间2022/10/27 13:42
  • 上次更新2023/10/27 05:38:11
查看原帖
能讲讲这个程序为什么能AC吗
571371
rrock楼主2022/10/27 13:42

#include<iostream>
using namespace std;
int main(){
	int T;cin>>T;
	while(T--){
		int n;cin>>n;
		string s[11],str;
		for(int i=1;i<=n;i++)cin>>s[i];
		cin>>str;
		for(int i=1;i<=n;i++){
			while(str.find(s[i])!=-1){
				int p=str.find(s[i]);
				str[p]='*';
			}
		}
		cout<<str<<endl;
	}
	return 0;
}

2022/10/27 13:42
加载中...