1050. String Subtraction (20)

简单的考察建立查询表

 题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1050

#include<iostream>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <string.h>
#include <algorithm>
using namespace std;

#define  MAX 1000
int main()
{
	string a, b;
	getline(cin, a);
	getline(cin, b);
	vector<bool> existed(MAX, false);
	for (int i = 0; i < b.size(); ++i)
		existed[b[i]] = true;
	for (int i = 0; i < a.size(); ++i)
		if (!existed[a[i]]) printf("%c",a[i]);
	printf("\n");
	return 0;
}


你可能感兴趣的:(pat,1050,ZJU)