PTA乙级 (1029 旧键盘 (20分))

1029 旧键盘 (20分)

https://pintia.cn/problem-sets/994805260223102976/problems/994805292322111488

#include <iostream>
#include <cctype>
using namespace std;
int main()
{
	string str1,str2,ans;
	cin>>str1>>str2;
	for(int i=0;i<str1.length();i++)
	   if((str2.find(str1[i])==string::npos)&&ans.find(toupper(str1[i]))==string::npos)
	    ans+=toupper(str1[i]);
	cout<<ans<<endl;
	return 0;     
}
posted @ 2020-01-31 21:39  yyer  阅读(149)  评论(0编辑  收藏  举报