View Code of Problem 3924

//#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <algorithm>
#include <iomanip>
#include<vector>
#include<math.h>
using namespace std;
int main()
{
	string s;
	cin >> s;
	string s1;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] != s[i + 1]) {
			s1 += s[i];
		 }
	}
	cout << s1;
}

Double click to view unformatted code.


Back to problem 3924