PAT甲级1050

佐手、 提交于 2020-01-13 08:47:22

#PAT甲级1050
讲述的主要是字符串处理,可以使用map解决

#include <iostream>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;

string s1,s2;

int main(){
	getline(cin,s1);
	getline(cin,s2);
	map<char,int>m;
	for(int i = 0 ;i < s2.length(); i++){
		m[s2[i]] = 1;	
	}for(int i = 0; i < s1.length(); i++){
		if(m[s1[i]] == 0){
			cout << s1[i];
		}
	}
	return 0;
}
/* 
They are students.
aeiou
*/



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!