您的位置:首页 > 编程语言 > C语言/C++

1050. String Subtraction (20)

2016-02-25 20:10 387 查看
#include <iostream>
#include <cstdio>
#include <unordered_set>

using namespace std;

int main(){
string s1, s2;
getline(cin, s1);
getline(cin, s2);

unordered_set<char> chars;
for(auto& c : s2)
chars.insert(c);

for(auto& c : s1)
if(chars.find(c) == chars.end())
printf("%c", c);

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  C++ PAT String Subtraction