输入一个字符串,求出该字符串包含的字符集合
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
int main() {
std::string str;
while(std::cin>>str) {
std::vector<char> v_c;
v_c.clear();
for(const auto& p:str) {
if(find(v_c.begin(), v_c.end(), p) == v_c.end()) {
v_c.push_back(p);
}
}
for(const auto& p:v_c) {
std::cout<<p;
}
std::cout<<std::endl;
}
return 0;
}
浙公网安备 33010602011771号