fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. string s;
  7. cin >> s;
  8. for ( int I=0;I<s.size();)
  9. {
  10. int j=I;
  11. while((j<s.size())and (s[j]==s[I]))
  12. j++;
  13. if(j==I+1) cout<<s[I];
  14. I=j;
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5420KB
stdin
eaeeacec
stdout
eaacec