输入:aabbccdd
输出:abcd
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;
int main()
{
string s;
getline(cin,s);
list<char> str(s.begin(),s.begin()+ s.length());
std::ostream_iterator<char> out(cout,"");
str.unique();
copy(str.begin(),str.end(),out);
system("pause");
return 0;
}