View Code of Problem 3924

#include <iostream>
#include<string>

using namespace std;

int main()
{
    string str,s;
    getline(cin,str);
  //  s = str[0];N
    for(int i = 0; i < str.size(); i++){
         while(str[i] == str[i+1]){
            i++;
         }
          cout << str[i];
    }

}

Double click to view unformatted code.


Back to problem 3924