PAT1050 String Subtraction (20 分)

解析

是集合A中的元素去掉集合B的元素。

#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;
int main()
{
	string input1, input2;
	getline(cin, input1);
	getline(cin, input2);
	set<char> Show;
	for (auto x : input2)
		Show.insert(x);
	string result;
	for (auto x : input1) {
		if (Show.find(x) == Show.end())
			result += x;
	}
	printf("%s", result.c_str());
}

``

相关文章:

  • 2022-12-23
  • 2021-09-20
  • 2021-09-18
  • 2021-09-11
  • 2022-12-23
  • 2021-12-28
猜你喜欢
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
  • 2021-10-22
  • 2022-02-14
相关资源
相似解决方案