View Code of Problem 3924

#include<iostream>
#include<string>
#include<algorithm>
#include<stack>

using namespace std;

int main() {
	string s;
	while (cin>>s)
	{
		char c = '0';
		for (int i = 0; i < s.length();i++)
		{
			if (s[i] != c)
			{
				cout << s[i];
				c = s[i];
			}
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3924