输入一个字符串,统计该字符串的字符
#include <iostream>
#include <string>#include <set>
using namespace std;
void main()
{
string str;
getline(cin, str);
set<char> charSet;
for (int i = 0; i < str.size(); ++i)
{
charSet.insert(str[i]);
}
for (set<char>::const_iterator it = charSet.begin(); it != charSet.end(); ++it)
{
cout << *it << endl;
}
}