每个测试输入包含2个字符串
输出删除后的字符串
Thy r stdnts.
题解:为每个字符打标记即可;
参考代码:
1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn=1e6+10; 5 char s1[maxn],s2[maxn]; 6 bool f[300]; 7 8 int main() 9 { 10 gets(s1); 11 gets(s2); 12 for(int i=0;s2[i];++i) f[s2[i]]=1; 13 14 for(int i=0;s1[i];++i) 15 { 16 if(f[s1[i]]) continue; 17 printf("%c",s1[i]); 18 } 19 puts(""); 20 21 22 return 0; 23 }
原文:https://www.cnblogs.com/csushl/p/11945996.html